joe_ma Posted August 17, 2016 Share Posted August 17, 2016 Hello I got a front page design consisting of a dozen of div elements. Some of them are containers for teasers, some are just decorations or ads or whatever. The problem I have is that the teaser blocks don't succeed each other: - div 1 (title) - div 2 (teaser) - div3 (ads) - div 4 (teaser) - div 5 (teaser) - div 6 (decoration) … You get the idea. The information for the teasers come from a page array ($teasers = $pages->find('selector')), no problem with that. But how can I scatter these to the teaser divs? I cannot use foreach to build divs that don's succeed each other, can I? Any ideas on how to achieve this are welcome. Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 17, 2016 Share Posted August 17, 2016 Maybe this is useful for you: http://cheatsheet.processwire.com/pagearray-wirearray/getting-items/a-eq-n/ 2 Link to comment Share on other sites More sharing options...
joe_ma Posted August 17, 2016 Author Share Posted August 17, 2016 Thanks a lot! Sounds promising. I'll give that a try. 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