owzim Posted June 4, 2016 Posted June 4, 2016 Hi, I want to get a page which is one of the current page's siblings. It's hidden and the following problem occurs: Case 1: Works if specified page is not hidden, but it has to be hidden, so not an option. $page->siblings->get("name=some-name"); Case 2: Returns a null page $page->siblings->get("name=some-name, include=hidden"); Case 3: Works $page->siblings("name=some-name, include=hidden")->first(); Case 2 should work, but it doesn't. Bug or feature?
ottogal Posted June 4, 2016 Posted June 4, 2016 As far as I see, the include attribute is working only with find(), not with get().
diogo Posted June 4, 2016 Posted June 4, 2016 Not completely sure, but I think get($selector) only works with $pages and not with other array objects, as opposed to get($key). You have one more option though: $pages->get("parent={$page->parent}, name=some-name, include=hidden");
LostKobrakai Posted June 4, 2016 Posted June 4, 2016 The strange thing is, that PageArray::get() is internally just syntactic sugar for $pa->find()->first(). So does this work? $page->siblings->find("name=some-name, include=hidden")->first(); Maybe the returned PageArray of siblings is already excluding your hidden page.
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