Jump to content

How to use existing modules


enochbenjamin
 Share

Recommended Posts

Hi and welcome to the forums.

What comes to modules, it is pretty different story from ie. Wordpress plugins. As far as I know there isn't lightbox module. Or you are looking for help on how to use lightboxes in general?

Most of the "how can I do this" -problems are easily solved on template level. You write some simple php code using PW api (www.processwire.com/api/) and you get the output you wanted. Just gives us more information what you need to achieve and I am sure we can help you.

Link to comment
Share on other sites

Here is typical scenario. You have images field called "images".

You loop them to show thumbnail of each, with link to original image (which we will open in lightbox):

<?php
echo "<div class='gallery'>";
foreach($page->images as $image) {;
       $thumb = $image->size(200, 200);
       echo "<a rel='gal' title='{$image->description}' href='{$image->url}'><img src='{$thumb->url}' alt='{$image->description}' /></a>";
   }
echo "</div>";

Then you load your js and css required by your lightbox script (probably in head):

<link rel='stylesheet' type='text/css' href='/site/templates/styles/colorbox/example4/colorbox.css' />
<script src='/site/templates/scripts/colorbox/colorbox/jquery.colorbox-min.js'></script>

Also, depending on the script you use, then you initialize the script:

$('.gallery').colorbox({rel:'gal'});

That is how you would do it in Colorbox: http://jacklmoore.com/colorbox/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...