Closed (works as designed)
Project:
Colorbox
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2012 at 16:06 UTC
Updated:
9 Apr 2020 at 17:04 UTC
Jump to comment: Most recent
Comments
Comment #1
mmncs commentedSubscribing
Comment #2
mmncs commentedHere is a solution for views:
Add a link to the header:
<a href="#" id="show-gallery">view gallery</a>Make a JQuery function like this:
If you want to a link for each item you can make a contextual filter on the image, add the file uri to the display and rewrite it for colorbox:
<a class="colorbox colorbox-inline" rel="gallery-all" href="[uri]">View gallery </a>Comment #3
CreativeJS commentedOk I'm a bit of a noob when it comes to colorbox and Drupal coding - what header do you add that first code line to? In the html of the page with the gallery or the page that you want to link the gallery from?
I would love to link THIS gallery from THIS page's photos and a direct link at the bottom.
Thanks in advance!!
-Jess
Comment #4
atiba commentedJess, it's also possible to add markup text to a Views header.
Simply make a new 'View' and there you'll find the Header option in section Block/Page settings.
I think you need to add the line of code up there.
I will check it out myself, i'll let you know if it works.
- Cesar
Comment #5
lsolesen commentedComment #7
nodecode commentedI'm changing the status here because the solution explanation is incomplete.
@mmncs: I fully understand where and how to implement the Views header code, however, can you please explain where and how the jQuery function is to be implemented?
Thank you for your time.
Comment #8
mmncs commentedHere is an explanation: http://drupal.org/node/171213
Comment #9
bellagio commentedDoes your view has 'field Content: Image (field_image_cache)' and
header <a href="#" id="show-gallery">view gallery</a>in the same view ?When you click on 'view gallery', it adds js to open image in the colorbox.
but where is your gallery?
i set up my view with 'field Content: Image (field_image_cache)' exclude from display and add header.
Then i call the view in node template, but when i click on the text link, nothing happens.
can you share screenshot of your view, or explain little bit further? thank you.
Comment #10
fraweg commentedHello,
the is a solution on #2 witch works great! Thanks for that! But what changes have I to make in the jquery-code if the content have two imagefields an I want want to user only one for the colorbox?
Best regards
Frank
EDIT: Another question: Is it possible to let it work with an image field that is excluded from the display ?
Comment #11
Genocode commented#2 solution definitely pointed me in the right direction. Also, if anyone is interested in additional functionality, you can view the source of Colorbox Example 5 and check out the jQuery examples.
My need went beyond starting the colorbox slideshow on the same view, I needed to start the colorbox slideshow that was on another view. However, I resorted to hyperlinks that pointed to the images and hid them (the links) within a div. Basically a replica of http://www.jacklmoore.com/colorbox/example5/
Comment #12
keerthithavas commentedHi,
I have created a view link in custom text to display the colorbox gallery if the link is clicked .But i dont know how to pass the image field as url .please share your thoughts.
Thanks,
keerthi.
Comment #13
neslee canil pinto