bbeer Posted August 24, 2015 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.
LostKobrakai Posted August 24, 2015 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");
Martijn Geerts Posted August 24, 2015 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
bbeer Posted August 24, 2015 Author Posted August 24, 2015 Hi Martijn your solution does the trick. Thanks a lot!
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