bbeer Posted August 24, 2015 Share Posted August 24, 2015 Hi all I have a problem listing pages when set on hidden I sue the following code. When I set to pages to unhidden the listing works well. Somehow I don't manage to find the problem. <?php $stellen = $pages->get("1035", "sort=sort", "include=hidden")->children; foreach ($stellen as $stelle){ ?> <div class="jobList clr"> <div class="col jobContent"> <h2><?php echo $stelle->longtitle;?></h2> <?php echo $stelle->body;?> </div> </div> <?php }?> Your help is much appreciated. Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 24, 2015 Share Posted August 24, 2015 I'm not sure where you came to this syntax, but the $pages->get() function doesn't work with multiple parameters. Also a single page can hardly be sorted in any way. $stellen = $pages->get("id=1035, include=hidden")->children; $stellen = $pages->get("id=1035, include=hidden")->children("sort=sort"); Link to comment Share on other sites More sharing options...
Martijn Geerts Posted August 24, 2015 Share Posted August 24, 2015 I've explained your selector below: // Get a page with ID 1035, // Sort that page with ID 1035 (You can't sort 1 page) // include page 1035 even when it is hidden (Get will always get the page, regardless if it is hidden) // Get the children of the page with ID 1035. (Will only get the visible pages) $stellen = $pages->get("1035", "sort=sort", "include=hidden")->children; I do think you want something like this: // Find pages with the 1035 parent // Sort it // Include the hidden children $stellen = $pages->find("parent.id=1035, sort=sort, include=hidden"); 2 Link to comment Share on other sites More sharing options...
bbeer Posted August 24, 2015 Author Share Posted August 24, 2015 Hi Martijn your solution does the trick. Thanks a lot! 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