owzim Posted June 4, 2016 Share 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? Link to comment Share on other sites More sharing options...
ottogal Posted June 4, 2016 Share Posted June 4, 2016 As far as I see, the include attribute is working only with find(), not with get(). Link to comment Share on other sites More sharing options...
diogo Posted June 4, 2016 Share 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"); Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 4, 2016 Share 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. 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