adrianmak Posted April 14, 2015 Share Posted April 14, 2015 I have the following page structure Home +----page1 (id=1) +----page2 (id=2) +----page2.1(id=3) +----page2.2(id=4) +----page2.3(id=5) +----page3(id=6) +----page3(id=7) I used following code to get a page url $pageurl[$page->get("id=1")->id] = $page->get("id=1")->url;I could get those url from id 1, 2, 6 and 7.However, I could not get any values from sub-pages of id=2, i.e. 3, 4,5 Isn't there need to supply other paramters to get a sub-page if another page? Link to comment Share on other sites More sharing options...
adrian Posted April 14, 2015 Share Posted April 14, 2015 I really don't understand what you are trying to do, but does it help if you use $pages instead of $page? I am guessing those ids are just examples? Also, you don't need "id=1" just: $pages->get(1) works. $pages->get() - returns one page from throughout the page tree $pages->find() - returns all matched pages from throughout the page tree $page->get() - returns the first matching child of $page although I think $page->child() makes more sense in this case Link to comment Share on other sites More sharing options...
adrianmak Posted April 14, 2015 Author Share Posted April 14, 2015 I'm sorry. I mess up with the $page api variable. I supposed to use $page for selecting a single page Link to comment Share on other sites More sharing options...
kongondo Posted April 14, 2015 Share Posted April 14, 2015 ....I supposed to use $page for selecting a single page Well this is simply not true. You use $page for getting the current page and $pages for getting any other page(s)... 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