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.

We've moved the forum!

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.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

lightbox effect in the images on the page


Go to End


5 Posts   1971 Views

Avatar
combinesom

Community Member, 10 Posts

4 November 2010 at 9:16am

hi!

how to prepare Silverstripe to be able to add the lightbox effect to the link in the image?

Sorry for my english :)

Avatar
swaiba

Forum Moderator, 1899 Posts

5 November 2010 at 1:27am

Hi,

we use pirobox here (same thing really) and it is very easy...

Add pirobox (in the require page init)...

Requirements::css('DIRECTORY/pirobox/style.css');
Requirements::javascript('DIRECTORY/pirobox/pirobox.min.js');
Requirements::javascript('DIRECTORY/pirobox/pirobox.config.js');

then when you are placing your images on the page in your template do something like this...

<% if MyImages %>
   <p>
       <% control MyImages %>
            <a href="$URL" title=" " class="pirobox_gall">
               <% control SetWidth(120) %>
                  $Tag
               <% end_control %>
            </a>
        <% end_control %>
   </p>
<% end_if %>

barry

Avatar
combinesom

Community Member, 10 Posts

12 November 2010 at 3:19am

Thank you for your reply. But this solution is unsatisfactory. For me it's not a problem but for inexperienced users it can be a difficult. Modification of the admin panel would be the optimal solution. For me it is too difficult. I believe that experienced developers of this forum will find a solution to this problem.

Avatar
swaiba

Forum Moderator, 1899 Posts

12 November 2010 at 5:03am

Ok, well, what you want is a module - actually a combination of image gallery/uploadify/dom should do it.

Avatar
combinesom

Community Member, 10 Posts

12 November 2010 at 9:32am

I think the solution is not so complicated. All you need to do is add to the link new attribute - "rel" and add to the header of page the address of the script which run the gallery effect. I can not modify the panel in the part responsible for adding the link to create a new option with the attribute "rel". Maybe you know which files should be modified?