There is integration from within views that extends the option "Link this field to the original piece of content". There is options to turn that link into a colorbox link automatically and provide the width and height as well.

I see this for, eg the content:title but on an image field I just see:
Link Image to: and a select box which has options: nothing, content and file.
ie no automatic colorbox set up.....
I got round it by including the field content:path and then set Rewrite the output of this field , ticked Output this field as a link and as suggested, (but using the [path] replacement value) set the link to
[path]?width=600&height=600
and set link class to colorbox-node.

But would be nice if this module handled all fields.
Let me know if I missed something.

Comments

iLLin’s picture

Status: Active » Closed (works as designed)

No the module is working as its supposed to. The only fields that are extended are the "link this field to the original piece of content" . The way you have changed it and re-wrote the values is the correct method.

jimboh’s picture

Thanks for the response
For anyone else interested... My previous suggestion works (this is wierd) in Ie9 but not in firefox and chrome. The link that is produced by this method has a double / in it (eg example.com/colorbox//content/gallery?page...etc)
The field 'path' has a leading slash eg /content/gallery. I had to use:
'Rewrite the output of this field' and set it to:

<a class="colorbox-node" href="http://example.com[path]?width=1000&height=480">[field_main_image] </a>

note the absence of / after .com
This works
Perhaps ie9 auto ignores the extra / and ff doesen't ??

iLLin’s picture

Status: Closed (works as designed) » Active

Lets open this back up and so I can track down this extra slash you noticed.

iLLin’s picture

Status: Active » Closed (cannot reproduce)

I can't reproduce that extra slash.

the_loeki’s picture

I can confirm the double slash;

I use Output this field as a link on my Image field, and set it to
[path]

If the Path field isn't set to 'absolute path' under Rewrite Results, at least on FF 15 the end result will be botched.

Target
partners/my-partner

Output
//colorbox/my-partner
With the absolute path setting on:
/colorbox/partner/my-partner

semei’s picture

Can anyone elaborate why the "Link this field to the original piece of content" is SUPPOSED to not be available for image fields?

honza pobořil’s picture

Issue summary: View changes
Status: Closed (cannot reproduce) » Active

Double slash issue is in the path field what generates absolute path, not Drupal internal path.

Soloution: Use NID field and "node/[nid]?width=600&height=600" pattern in image field rewriting.

iLLin’s picture

Status: Active » Closed (works as designed)

This module extends the link this piece of content functionality. The rewrite method is the appropriate workaround for any other links you need to create.