Hi I am trying to use the custom caption option however the replacement patterns do not display the any token for the custom caption field I created.

The field is called teaser caption and I have tried [Content: Teaser Caption] I have also tried [field_teaser_caption].

Otherwise is it my misunderstanding that you can only use replacement patterns that are provided for the caption custom (with tokens) option.

Files: 
CommentFileSizeAuthor
#20 colorbox-views-replacement-patterns-1947796-20.patch580 bytesspacetaxi
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

dpearceMN’s picture

So ColorBox captions can't use content from "Fields" fields?

dpearceMN’s picture

Status:Active» Closed (works as designed)

Found what appears to be an undocumented token:

[node:field_name]

This token may be implemented somewhere else, but it does work.

Road Kill’s picture

Thank you dpearceMN tried [node:field_name] but no joy I am thinking that maybe colorbox can not use custom tokens.

dpearceMN’s picture

Actually, yes it does work in ColorBox because I am using it. Why it doesn't work for you is another question.

Road Kill’s picture

Status:Closed (works as designed)» Active
StatusFileSize
new6.16 KB

Hi that’s interesting if it is working for you but for my view the caption is not visible. I have attached the view you can take a look if you like maybe I have misconfigured it.

I used the following token [node:field_teaser_caption] based on the [node:field_name] token.

Road Kill’s picture

DpearceMN please keep in mind you can not change the status of an issue based on your circumstances and opinion Status: active » closed (works as designed) just because it works for you. There are many reasons why this could be working for you but not for me.

ManuV’s picture

garamani’s picture

same issue
there is no token available related to nodes or fields.
I'm using field collection for step by step articles. each step has an image and a title. Now I want to make an slideshow to visualize the article via Colorbox.
I've created the View, added fields and changed the image field formatter to Colorbox but there is no token available to add "step " title" as caption.
Tokens Avilable:

  • Current date
  • Current page
  • Random
  • Site information
  • Current user
  • Files

colorbox version: 7.x-2.4

lejonsson’s picture

I have also run inte this problem, no field tokens are available for the "Custom (using tokens)" caption option in Colorbox, only the tokes garamani listed above.

stewart.adam’s picture

Title:Custom caption field tokens» Colorbox does not show node related token in the custom caption replacement pattern browser
Version:7.x-1.5» 7.x-2.4
Category:Support request» Bug report
Issue summary:View changes

Updating issue status, can confirm with 7.x-2.4.

The node tokens are replaced, but do not appear in the token browser. Likely a small change in colorbox_field_formatter_settings_form() is required to pass the $node object to the token module.

Marko B’s picture

I can confirm the same problem. No node tokens or replacement patterns (for example other fields in View you have).

Marko B’s picture

Also, maybe this is another issue. Token list FILE tokens but when you try to access any of them you get empty results.

djh007’s picture

Can confirm that updating to Colorbox 7.x-2.7 does not fix this issues. No field tokens are visible in the caption replacement patterns, and trying to use a token that's not listed just result in "[token]" being outputted.

Any suggestions on how to get this to work?

djh007’s picture

The [node:token] approach seems to work for basic node tokens, but trying to use [node:image_alt] and [node:image_title] to use image metadata does not work.

Tried updating to dev. These tokens are not available to colorbox.

maxperience’s picture

Hi I came accross the same issue. My solution was to use the Colorbox Trigger field. Add this field to your view. You can then use the fields that come before this field (in your view) as a replacement token.

glkr’s picture

I used colorbox trigger field to display text fields as captions, too. However, clicking on image to display next image doesn't work with colorbox trigger. Is there a way to enable click on image to display next function with colorbox trigger?

clemens.tolboom’s picture

Version:7.x-2.4» 7.x-2.x-dev

As this is not solved in latest 7.x-2.7 let's change version to dev so the developer can review this bug.

kopeboy’s picture

Title:Colorbox does not show node related token in the custom caption replacement pattern browser» Views: Replacement patterns and node tokens are not replaced in caption
Component:User interface» Miscellaneous

Yes please, review this.
I cleaned the issue title..

How to use replacement patterns and/or node/field tokens in a Colorbox caption with Views?

If I select "Custom (with tokens)" as the caption, even the view fields' replacement patterns won't work.

chadsten’s picture

Is there any word on when this will be added to the module? Exposing just these global tokens really doesn't help what seems to be anyone.

spacetaxi’s picture

StatusFileSize
new580 bytes
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

This patch adds the parent entities to the list of available tokens. It fixes a line which was calling the entity_type of the $instance, which appears to be 'ctools' in the view. I did not test with fields that appear in multiple entities, but should work.

spacetaxi’s picture

Status:Active» Needs review
fbreckx’s picture

I do see the tokens in the list, but the value doesn't apear under the picture.
Trying to display the node description as caption.