caribou Posted December 14, 2012 Share Posted December 14, 2012 I want to list the names of pages with the template "individual", so I did this... <?php foreach($pages->find("template=individual") as $page) echo $page->name; ?> It echos an array of page names, as expected, but then it throws one page body (and just one) at the very end of the file. Where is that page body coming from? I'm stumped. UPDATE Never mind, solved my own problem. Renamed $page to something else, and it worked as expected. Link to comment Share on other sites More sharing options...
diogo Posted December 14, 2012 Share Posted December 14, 2012 Not from that code... must be something you have after it Link to comment Share on other sites More sharing options...
Pete Posted December 16, 2012 Share Posted December 16, 2012 It'll be because $page is always the current page array so I'm assuming that diogo is correct and you're echoing $page->body somewhere below that and it's getting confused. Your solution to change the name is correct of course - it was just getting confused as you were causing it to interfere with the original pagearray for that page. 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