Hi,
I'd also like to start (for example) LightBox directly from a link on a picture somewhere on a silverstripe website (not just from the supported gallery page).
Could someone please give me a hint?
Cheers
Jonas
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi,
I'd also like to start (for example) LightBox directly from a link on a picture somewhere on a silverstripe website (not just from the supported gallery page).
Could someone please give me a hint?
Cheers
Jonas
I am also trying this, so far I've been able to get it to work by using the following lines in my new 'MyPage.ss', whilst having the image_gallery mod installed:
<script type="text/javascript" src="jsparty/jquery/jquery.js"></script>
<script type="text/javascript" src="image_gallery/gallery_ui/lightbox/javascript/jquery.lightbox-0.5.js"</script>
<script type="text/javascript" src="image_gallery/gallery_ui/lightbox/javascript/lightbox_init.js"></script>
<link rel="stylesheet" type="text/css" href="image_gallery/gallery_ui/lightbox/css/jquery.lightbox-0.5.css" />
<link rel="stylesheet" type="text/css" href="image_gallery/css/ImageGallery.css" />
And this in my .ss
<% if Photo %>
<a rel="lightbox" class="lightbox" title="$Title" href="$Photo.URL"><% control Photo.SetWidth(130) %><img src="$URL"<% end_control %>alt="$Title"/><% end_if %>
But it seems to have an issue and is showing multiple images in the count even when there is only 1... but this may be my .ss file not sure yet.
If only it used a more advanced template language this could be done in one line. Such a good framework let down by the template.
Yeah I am giving it a go. I have been used to working with Smarty I think I am just finding such a difference but I love the framework and whole MVC logic.
The first thing I came across was using the 2 IF statements that I couldnt do in the template (maybe its not supposed to go in the template) but I was trying to wrap a simple IF statement round a subnav where in smarty I would of done:
I ended up with this:
<% if LinkingMode == current %> mainNav-Sub_Always<% end_if %><% if LinkingMode == section %> mainNav-Sub_Always<% end_if %>
{if $LinkingMode eq 'current' || $LinkingMode == 'section'}
I have bought the book so when that arrives will hopefully that gets me going.
I had a similar question some time ago. I wanted to open a lightbox by clicking on a photo in the actual page content.
It was suggested, at the time, that I do a string replace in the PHP. Create a function called Content() and then do a bit of string manipulation, putting the link around the "<img>" tag.
That's always possible, too.