Troost Posted September 27, 2019 Share Posted September 27, 2019 Hiya PW's! I'm currently busy with a simple portfolio theme for a girlfriend. She asked me for a lightbox, but it won't work out the way as I wanted it... (ofcourse) I'm using the Lightbox by Lokesh Dhakar https://lokeshdhakar.com/projects/lightbox2/ The structure is: Home - Portfolio -- Item 1 -- Item 2 -- Item 3 The page echoes the 'werk' field on the item page. Which is one single image. I rendered the next string for text in the PW field. <a href='{url}' data-lightbox='image' data-title='{title}'><img src='{url}' alt='{description}' class='masonry-content image' /> <div class='hover-text'>$project->title</div> </a> Here's my code <div class="row portgallery animated fadeInUp margdown100"> <div class="masonry-wrapper"> <div class="masonry"> <?php $projects = $portfolio->children("template=portfolioitem, sort=-created"); foreach ($projects as $project) { if ($project->werk) { echo "<div class='masonry-item animated fadeInUp'>"; echo "$project->werk"; echo "</div>"; } } ?> </div> <!-- /masonry --> </div> <!-- /masonry wrapper --> <script src="https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.js"></script> The images opens in a new windows instead of the lightbox, since I've read the documentation of the Lightbox I can't find where im going wrong. Also the div hover-text ain't echoing out the $project->title Can someone help me out? The goal is to open the images from the home/portfolio page in the lightbox. So that they can navigate trough the images. Here is a link of the projecthttps://tinyurl.com/yxhg9xvs Thanks in advance, Hugo Link to comment Share on other sites More sharing options...
BitPoet Posted September 27, 2019 Share Posted September 27, 2019 Looks like you need to include jquery in your page (see point 4 in the lightbox2 getting started docs). 1 1 Link to comment Share on other sites More sharing options...
Troost Posted September 27, 2019 Author Share Posted September 27, 2019 Thanksssss BitPoet, thanks! I had to use the jQuery file indeed, thanks alot!! 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