Jump to content

$pages->get cannot include hidden


Recommended Posts

Hi all,

I'm trying to get children of a page not matter if hidden or not. This is how I do:

$media_tags = $pages->get("template=fundus-index,include=all")->children("sort=title");

The children I'm looking for name 'Video,Bilder,Audio, Text' (as screenshot attached shows).

The moment I uncheck the 'hidden' attribute of let's say video it's showing in my search. Can one kindly shade light into what I am doing wrong with ->get()



Bildschirmfoto 2020-04-17 um 19.14.42.png

Link to comment
Share on other sites

You need the include=all in the children selector.

$media_tags = $pages->get("template=fundus-index")->children("include=all, sort=title");

You could also find the children directly by specifying the parent in the selector, eg:

$media_tags = $pages->find("parent=fundus_id, include=all, sort=title"));

replacing fundus_id with the ID of that parent page.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...