kradzcalypse Posted August 8, 2015 Posted August 8, 2015 Hello, There are 3 image fields which I want to display in a slideshow on page called main.php. The problem is I could not find the correct query strings. Please help me. TQ main.php codes <ul> <!-- SLIDE --> <li data-transition="cube" data-slotamount="7" data-masterspeed="300" data-link="http://www.//portfolio/" data-saveperformance="off" > <!-- MAIN IMAGE --> <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="Modern-Marketing-Partners-Naperville2" data-lazyload="<?=$page->image->Slide1;?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> </li> <!-- SLIDE --> <li data-transition="cube" data-slotamount="7" data-masterspeed="300" data-link="http://www.//marketing-services/" data-saveperformance="off" > <!-- MAIN IMAGE --> <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="MMP_Homepage_D_nirvana" data-lazyload="<?=$image->url->Slide2;?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> </li> <!-- SLIDE --> <li data-transition="cube" data-slotamount="7" data-masterspeed="300" data-link="http://www.//resources/" data-saveperformance="off" > <!-- MAIN IMAGE --> <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="Marketing-Next-Practices" data-lazyload="<?=$image->url->Slide3;?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> </li> </ul>
adrian Posted August 8, 2015 Posted August 8, 2015 Hi @kradzcalypse and welcome to the forums. Instead of: $page->image->Slide1 what you are looking for is: $page->image->eq(n) where "n" is the number of the image in the image field, starting at 0. Since you named it "image" and not "images" is it set up to handle more than one image?
kradzcalypse Posted August 8, 2015 Author Posted August 8, 2015 I'm sorry, I don't quite understand. Do you mean the should be like this ? <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="Marketing-Next-Practices" data-lazyload="<?=$page->image->eq(1);?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> what is eq ?
adrian Posted August 8, 2015 Posted August 8, 2015 Yep, that should do it. Take a look at the cheatsheet for learning about eq. You have three options for grabbing items from a PW array: ->first() ->last() ->eq(n) Typically with a slider you foreach through $page->images as $image, but it seems like you only have three images and you have distinct URL links for each one, so calling each one individually like you have might just be easier.
kradzcalypse Posted August 9, 2015 Author Posted August 9, 2015 (edited) Problem solved by modifying code to : <ul> <!-- SLIDE --> <li data-transition="cube" data-slotamount="7" data-masterspeed="300" data-link="http://www.//portfolio/" data-saveperformance="off" > <!-- MAIN IMAGE --> <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="Modern-Marketing-Partners-Naperville2" data-lazyload="<?php echo $page->Slider1->url; ?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> </li> <!-- SLIDE --> <li data-transition="cube" data-slotamount="7" data-masterspeed="300" data-link="http://www.//marketing-services/" data-saveperformance="off" > <!-- MAIN IMAGE --> <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="MMP_Homepage_D_nirvana" data-lazyload="<?php echo $page->Slider2->url; ?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> </li> <!-- SLIDE --> <li data-transition="cube" data-slotamount="7" data-masterspeed="300" data-link="http://www.//resources/" data-saveperformance="off" > <!-- MAIN IMAGE --> <img src="<?=$config->urls->templates;?>assets/wp-content/plugins/revslider/images/dummy.png" alt="Marketing-Next-Practices" data-lazyload="<?php echo $page->Slider3->url; ?>" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"> <!-- LAYERS --> </li> </ul> Edited August 9, 2015 by kradzcalypse
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