My site is heavy on images and it's mandatory to display them beautifully on the high ppi screens (majority of our users nowadays).

The best solution for us is to use images with higher dimensions than those set with CSS, ideally 2X.

My colorbox image galleries generating from Views (when opened) will display images at original style (their original dimensions), which sometimes causes the Colorbox popup to be bigger than the screen (ugly and unacceptable).

When I build custom links I can set width & height in the link text, or, if I don't, the max width / height from Colorbox settings page get applied, but when I use the Views' image field Colorbox style to create galleries those don't apply.
I have no option in Views on my image fields to select the max width/height of the colorbox pop-up.
How to force it to say 90%x90% of the screen?

Thanks

Comments

kopeboy’s picture

Just to let you know: my current workaround is to set this in CSS:

.cboxPhoto {
    max-width: 1200px;
    height: auto !important;
}

but of course is not flexible..

kopeboy’s picture

Issue summary: View changes
kopeboy’s picture

Category: Support request » Bug report
Priority: Major » Normal

UPDATE: I found a workaround
but the problem (I am switching this to a bug now) remains.

Workaround:

  • on the view image field don't use Colorbox, and select the image style you want in the view's list.
  • in Advanced > Relationships, add a relationship to the file of your image field, like "Field: Photo:fid"
  • then in the View fields add the file path field, set the relationship, so to have like "(image from field_image) File: Path", check "Display download path instead of file storage URI" and set to Exclude from display
  • then you want to link the image field (or whatever you are showing in your Views generated list) to the file path (will be the original image style's one) with a "colorbox" link class, so it will open in a colorbox (with working max width/height). To do that, in Rewrite results, check Output this field as a link and set the path to "[uri]" (will be in Replacement patterns if you did set the file path field before the rewritten one) and the Link class to "colorbox". If you want a gallery of all the view rows set also Rel text to "gallery-all".

That's it.

neslee canil pinto’s picture

Status: Active » Closed (won't fix)