Is there currently a way to display a node-link in colorbox?

I've seen something in the issue queue about using 'Colorbox trigger field', but it has no documentation and I don't know where that is (or how to use a view to display colorbox)

If this isn't availible, then I'd like to request the feature ;)

Comments

Anonymous’s picture

Oh and to clarify, I'd like colorbox to display my image, my image title and then the image's node title as a link.

Jerome F’s picture

Status: Active » Fixed

In views 3 you need to display fields for your view, check that colorbox module is enabled.

Create all the fields you need (image, image title, image's node title as a link.) Exclude them from display.
And create a trigger field (e.g. the image field rewrited to any text you want).

Then you can add a field called: Colorbox: Colorbox trigger in your view.
Select the trigger field in the select list.
In the Popup textarea use the replacements patterns of your fields.

side note: For an image gallery with thumbnails, there's a Formatter available in the image field in views.

Anonymous’s picture

for clarification, is this for a viewI'm creating, or is this part of a way to override colorbox defaults?

Jerome F’s picture

You need to create a view to do what you want.

Anonymous’s picture

Could you explain this more?:
"And create a trigger field (e.g. the image field rewrited to any text you want)."

Once I get this, I'll write it up for documentation.

Jerome F’s picture

I mean create a field which triggers the colorbox. It can be any field, like the nid, custom text, etc. But I would use the actual image field, because then you can hide the field if there's no result. If you don't need an image, but would prefer something else, like a text, you can use the Rewrite in views and type in some text there or use replacement patterns to combine some other fields.

joostvdl’s picture

Category: support » bug
Status: Fixed » Active

The "replacements patterns of your fields" are not shown when editing the Colorbox trigger settings.

Jerome F’s picture

Category: bug » support
Status: Active » Fixed

Yes they are, although you have to go under:
Configure field: Colorbox: Colorbox trigger > Rewrite results > Rewrite the output of this field (check temporarilly and uncheck once you're done) > replacement patterns

copy the replacement patterns for each field you need, paste them in the popup textarea. Make sure to uncheck Rewrite rules after you've finished.

Anonymous’s picture

Status: Fixed » Active

Another question on this. In Views 3, how can you chose Image[alt] or Image[title] as your field?

For instance, the colorbox default shows the image with it's [alt] caption. I'd like the view to show the image with a link to it's node and it's [alt] caption.

Jerome F’s picture

drwierdo’s picture

Hey,
Has anybody done this successfully? What i have managed to do is get a list of title of the nodes the images are from. When i click them, they link to the content...have been completely unsuccessful in making node-link to appear in the popup text area, below the image...please write the promised documentation Mtro and link it here!!
Until then can anybody please explain this more clearly??

drwierdo’s picture

I made it work. I have a jCarousel view of images and what i wanted was, while clicking on the image in the view, a colorbox should open, which would contain the image and the link to its node.

All this time, i had done every other thing right except that the image styler for the image field (which was excluded from the view) was still set to colorbox. So, whenever i clicked the image, before the colorbox trigger could access it, the image would be opened by the colorbox.

The solution was simple, making the core Image as the image styler for the image field and linking it to nothing. So, the next time i clicked on the image in the view, the colorbox trigger would come into play and display the image and its title link in the colorbox....and that's it!!!
Enjoy!!

drwierdo’s picture

for more information http://drupal.org/node/799216

halltruck’s picture

Documentation, and perhaps a tutorial online, would be greatly appreciated with this.... It's very unclear and colorbox is a kickass slideshow.... which makes these confusing steps very frustrating. I would love to have colorbox on my site, however, I can't get around this problem.

Anonymous’s picture

I never got how this was meant to work. I'm still interested in knowing. Maybe a few screenshots of a working views configuration would be helpful?

Coldice4678’s picture

Version: 7.x-1.0-beta4 » 7.x-1.3
Component: Code » Documentation

I see this thread is old, but I figured out how to link a View link to a colorbox-node.

I am using D7.dev of Colorbox_Node
(You need to use both the Colorbox and Colorbox_Node Modules)

the main thing is NOT to use the Colorbox Trigger, instead just use a Title Field.

In the Title field there are these options, Check mark both of these:
-Link this field to the original piece of content
-->Display the content inside of a colorbox.

Now the whole Title Field is a Link to a Colorbox of the Full Node.

Styling:
if you want added fields, images, and etc. add them above the Title Field.
Then check mark "Exclude from display" in every field except for the Title Field.
Now go back to the Title Field and check mark "Rewrite the output of this field"
and use the "Replacement Patterns" to add the elements you want to render
You can be creative and wrap the "Replacement Patterns" in

and etc, and use CSS to make it pretty.
Note 1: No need to add any anchor links because the 1st step made the whole row a link to the ColorBox_node
Note 2: Do not waste your time with the Colorbox Trigger Field if you want a link to a Full ColorBox_Node. This should only be used if you want a ColorBox pop-up with view_fields.

lsolesen’s picture

Status: Active » Fixed

There is an answer, so marking this as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rachelf’s picture

The info above got me on the right track and here's how I did it (with Views 7.x-3.3 and Colorbox 7.x-1.3 - I didn't need Colorbox_Node).

I have one image per node so I made a view of that content type.

I added the following fields to the view:

  • Title - no link, exclude from display
  • Image - no link, thumbnail size, exclude from display, rewrite output with replacement patterns as [field_image] [title]
  • Image - link to content, full size, exclude from display
  • Title - as link, exclude from display

I then added a fifth field of type Colorbox Trigger and configured that so that

  • the trigger was the first image field (i.e. a thumbnail of the image with its title)
  • the popup was the second image field (i.e. the full size)
  • the caption was the second title (i.e. the one with the link)

The result was a page displaying all the images as thumbnails with the title next to each, clicking on either the image or the title triggered the colorbox. The colorbox content was a full size version of the image which then linked to the full node for that image, and the caption was the title for the image, again linking to the full content.

Hope this helps someone else!

Québec’s picture

Hi,

It would be appreciated if someone could reexplain again. I just cannot transform the title of the node into a link to that node (for images). I'm using a content type with title, image and taxonomies.

In structure > content-type > display : do I have to change «image» to «colorbox»? I tried the previous method but missed something.

I have a simple view of images in a grid.

Thanks.

dolly nyc’s picture

if you're working with a view then you shouldn't have to change the content type's display. the basic trick is to load the fields that you want in the colorbox but exclude from display. then add another field of type Colorbox Trigger: if you want to click the title to trigger the colorbox, then configure the colorbox trigger to fire off the Title field (similar to #22 but not exactly) instead of the image