I need to display additional information in the colorbox caption for image fields. The only way I am able to do this was with views colorbox trigger field, however, this forces me to set an explicit width and height for the pop up window. The images that I want to display in the pop up are in horizontal and vertical format, and I want the width and height to be adjusted accordingly... so I can't set an explicit dimension.

It would be nice if there was an option to simply change the caption when selecting the colorbox formatter for an image field instead of the long-winded excluded fields + colorbox trigger.

Comments

frjo’s picture

Status: Active » Postponed

This would be a neat feature. I will take a look at how easy it would be to implement in a nice and clean way. It will however most likely take some time before I commit time to it.

iancu35’s picture

it would be nice to have a "description/ teaser" caption hover options, besides "title, alt text, node title"
so you can choose using CTRL two/ more options at one time for an image colorbox formatter in: a view slideshow/ ddblock
eg. photo + title + description - fluid height/ width

many thks. frjo for your work and screencasts

pollegie’s picture

Subscribing

ohcray’s picture

subscribing

frjo’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Postponed » Fixed

You now can use tokens to construct the caption in the Colorbox formatter. That should fill this need I believe.

Status: Fixed » Closed (fixed)

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

jonvaljean’s picture

Hello, thanks to frjo for the great work and instructive videos.
I would like to do this, but frjo's post

You now can use tokens to construct the caption in the Colorbox formatter. That should fill this need I believe.

is a little too little for me to follow. Could anyone give a more expansive explanation, so I could try this ?

Thanks.

frjo’s picture

Go to your content types "Manage display" tab and go to the formatter settings for your image field (the small cog wheel to the right).

There you have different options for the Caption. If you want to use tokens select "Custom (with tokens)".

jonvaljean’s picture

Thank you frjo for this response.
I am afraid that I am wasting your time, but I am too new to this to understand "how to use tokens" ... I am simply trying to use the caption space to insert some formatted HTML, not just a caption, but a description. I do not know how to enter this HTML, since I do not know "how to use tokens".

Could you or someone give me a little more direction ?

THanks for your patience.

Jon

BWPanda’s picture

Issue summary: View changes

I came across the same issue as the original poster - wanting to use a custom caption but not liking the way the Colorbox trigger field made me specify an explicit width and height... I also didn't want to use tokens (as the data I needed was already in Views).

I discovered that you can use Views' own replacement patterns to specify the width and height of the Colorbox popup (assuming you're displaying an image in Colorbox):

  1. Click on the image field you're using in the Colorbox trigger's 'Popup', expand 'Rewrite results' then tick 'Rewrite the output of this field'
  2. Look under 'Replacement patterns' and you'll see different options for your image field (such as alt, title, width and height)
  3. Copy the height option (mine is [field_image-height]) then Cancel your changes (we don't want to rewrite the field's output)
  4. Click on the Colorbox trigger field and paste the copied value into the 'Height' field
  5. Do the same for the 'Width' field, but change '-height' to '-width'

You can now use the full power of the Colorbox trigger field, but don't have to worry about setting an explicit width and height.
BTW, I'm not sure why the extra alt, title, width, etc. options don't appear under all the other 'Replacement patterns'...

highflyer’s picture

#10 works great. Thank you:)