mntob Posted October 29, 2018 Share Posted October 29, 2018 I've just started to use Processwire, for now I'm very happy, for now I have one question, sorry if this is a beginner question?. is it possible to make foreach loop like this? <?php foreach ( $pages->find('template=itemProduct1ingle, itemProduct2ingle, sort=-created') as $all ):?> <div class="col-12 col-md-6 col-lg-4 col-xl-3"> <h6><a href="<?=$all->url?>"><?=$all->title?></a></h6> </div> <?php endforeach; ?> I need to list all items from two templates on home page, I hope you understand me ? Link to comment Share on other sites More sharing options...
Zeka Posted October 29, 2018 Share Posted October 29, 2018 @mntob Yes, it's possible. Take a look at Selectors docs. https://processwire.com/api/selectors/ Your selector shoud be like template=itemProduct1ingle|itemProduct2ingle, sort=-created 5 Link to comment Share on other sites More sharing options...
mntob Posted October 29, 2018 Author Share Posted October 29, 2018 1 minute ago, Zeka said: @mntob Yes, it's possible. Take a look at Selectors docs. https://processwire.com/api/selectors/ Your selector shoud be like template=itemProduct1ingle|itemProduct2ingle, sort=-created Wow, thank you! ? Link to comment Share on other sites More sharing options...
dotnetic Posted October 29, 2018 Share Posted October 29, 2018 @mntob I would like to request adding a [SOLVED] to the title of this thread. This helps others who are looking for working solutions and if an answer is still needed or not. Thank you ? 1 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