Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Adding a lightbox image: control 'normal' size?


Reply

5 Posts   1543 Views

Avatar
pinkp

20 May 2010 at 10:02am Community Member, 168 Posts

I have added this code to my image gallery to include another image in the lightbox gallery its works perfectly apart from the config settings don't change the 'normal' size of the image (when it pops up). It just appears full size!
How do I do this please?

GalleryUI_layout.ss

<% if CoverImage %>
<div id="MainImage"><a id="ViewLink" rel="lightbox" class="lightbox" title="$AlbumTitle" href="$CoverImage.URL"><% control CoverImage.SetWidth(250) %>
               <img src="$URL"<% end_control %>alt="$AlbumName"/></a><p>$MainImageTitle</p></div>
<% end_if %>

Avatar
UncleCheese

20 May 2010 at 12:57pm 4085 Posts

Look at your href:

href="$CoverImage.URL"

You're linking to the original image, with no resampling. Don't you want something like $CoverImage.SetWidth(500).URL?

Avatar
pinkp

20 May 2010 at 8:04pm Community Member, 168 Posts

IT doesn't work it just shows .URL on the front end and the link is broken. I tried the other way around .URL first still not luck. Do you know another way? many thanks!

Avatar
UncleCheese

21 May 2010 at 1:37am 4085 Posts

<% control CoverImage %><% control SetWidth(500) %>$URL<% end_control %><% end_control %>

Avatar
pinkp

21 May 2010 at 7:01am Community Member, 168 Posts

That works great thank you!

for any one else who needs it this is how my code looks in GalleryUI_layout.ss:

<a id="ViewLink" rel="lightbox" class="lightbox" title="$MainImageTitle.XML" href="

<% control CoverImage %><% control SetHeight(500) %>$URL<% end_control %><% end_control %>
"><% control CoverImage.SetWidth(250) %>
               <img src="$URL"<% end_control %>alt="$AlbumName" title="$AlbumName"/></a>