3

My goal is to create a gallery of all media of the site. I created a views-page of type file with bootstrap grid format that displays all file type of my site (File: Mime type (has word jpeg jpg png gif YouTube)).

My first problem is to get lightbox or Colorbox to display the file on click on the page. Is there any way I can get lichtbox in code (css, function,...) or views showing only file.(Note I'm not using fields but file). That mean when I'm on the views-created page, I can click on any file(image or video) and it react with lightbox overlay.

The second one is to remove certain content type files from the views display. (I don't want user profile images to be displayed or private files).

Thirdly, i want to create a menu to sort the file per type(image, audio, images, and taxonomy terms.) Maybe there is a good tutorial for this on google. I couldn't find anyone, ;)

2 Answers 2

2

My first problem is to get lightbox or Colorbox to display the file on click on the page

For this you need to set either lightbox or colorbox module. Once you install and enable the site you will see the option in file field to show the file in lightbox.

he second one is to remove certain content type files from the views display

Add a filter criteria File Usage: Entity type or File Usage: Entity Id and exclude user entity.

Thirdly, i want to create a menu to sort the file per type

For this you need to add a sort criteria based on your File:Mime Type

8
  • This is great! Thanks for your help. I've the lightbox2 module installed and enabled. But i can't find anyway to use it in views on the show (format). Note that i'm not using the file field for my field. there are different type of fields that are being dirplayed(image, body-embeded). For the sort criteria, my aim was to create a menu with Mine Type and taxonomy. I tried your example, but can't get only png or jpeg image to be shown!
    – danyhiol
    Dec 9, 2015 at 21:43
  • You should get option for your file in your field. Don't look under format. look in your field which you want to show in colorbox
    – Shabir A.
    Dec 10, 2015 at 13:44
  • Here is my views: FORMAT Format:Bootstrap Grid | Settings Show:File | Default FIELDS The selected style or row format does not utilize fields. I want to make the change in views. When possible.
    – danyhiol
    Dec 10, 2015 at 15:53
  • Please provide the screenshot of your view if possible?
    – Shabir A.
    Dec 10, 2015 at 16:13
  • link here ist a link of my settings in views.
    – danyhiol
    Dec 10, 2015 at 16:42
0

1)install "Image URL Formatter" module

2)go to the field settings of your view find "image" field from which images are comming click on it a Configure field: dialogue box will open you will see "Formatter " option in it change it to "image url " by this you will get url of your image

3)add global custom:text field check replacement pattern fetch the replacement pattern of your image url

write some code like this in global custom:text->

<a class="colorbox" href="[field_place_image_1]" rel="lightframe[|width:400px; height:300px; scrolling: auto;]" >image</a>

1
  • Thanks for your reply Vicky8888. I've the "Image URL Formatter" module installed and enabled. The problem is that I'm working with "file" and not "fields" or only "Image" in views. I also have the "lightbox2" module installed and enable. There is no way i can do that directly in views. So I want my file to respond to lightbox on click.
    – danyhiol
    Dec 10, 2015 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.