enochbenjamin Posted December 6, 2011 Share Posted December 6, 2011 I am new to processwire and trying to figure out how to use the modules (i.e lightbox) Is there a tutorial or video to help a complete noob? Link to comment Share on other sites More sharing options...
apeisa Posted December 6, 2011 Share Posted December 6, 2011 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 More sharing options...
enochbenjamin Posted December 6, 2011 Author Share Posted December 6, 2011 So if i am following you correctly i just create the code for lightbox just as i would in html and then call it in a template??? Link to comment Share on other sites More sharing options...
apeisa Posted December 6, 2011 Share Posted December 6, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now