7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Adding a lightbox image: control 'normal' size?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1263 Views |
-
Adding a lightbox image: control 'normal' size?

20 May 2010 at 10:02am
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 %> -
Re: Adding a lightbox image: control 'normal' size?

20 May 2010 at 12:57pm
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?
-
Re: Adding a lightbox image: control 'normal' size?

20 May 2010 at 8:04pm
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!
-
Re: Adding a lightbox image: control 'normal' size?

21 May 2010 at 1:37am
<% control CoverImage %><% control SetWidth(500) %>$URL<% end_control %><% end_control %>
-
Re: Adding a lightbox image: control 'normal' size?

21 May 2010 at 7:01am
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>
| 1263 Views | ||
|
Page:
1
|
Go to Top |

