bwakad Posted September 23, 2014 Share Posted September 23, 2014 Just trying something for the prev next functions but I really do not understand, this first one not giving anything contrary to second one. While $page->parent is really a /path/. I have tried without ->name, without qoutes, placed $variable as concatenated outside of qoutes... Nothing seem to do it. Must be loosing my mind. lol <?php $navigation = $pages->find("parent=/{$page->parent->name}/");?> <?php $navigation = $pages->find("parent=/browse/");?> Basically I want the current page parent children as array (siblings). Only on rootparent = home I could not do that (because no parent)... Link to comment Share on other sites More sharing options...
Soma Posted September 23, 2014 Share Posted September 23, 2014 IS that the real path or jus one segment. What if you try to get it with pages->get('/name/') to test instead of find. Link to comment Share on other sites More sharing options...
diogo Posted September 23, 2014 Share Posted September 23, 2014 Unrelated to the question, but just to say that you can do: <?php $navigation = $pages->find("parent={$page->parent}");?> Edit: or even: <?php $navigation = $page->siblings; ?> Link to comment Share on other sites More sharing options...
Soma Posted September 23, 2014 Share Posted September 23, 2014 Or what about? $navigation = $page->siblings; or $navigation = $page->parent->children; Your both codes are the same if {$page->parent->name} returns "browse" Link to comment Share on other sites More sharing options...
bwakad Posted September 23, 2014 Author Share Posted September 23, 2014 I have tried both from Soma and Diogo - not working. In this case, they both should reflect "/browse/". Using static works, dynamic not. Strange. I just used $page->parent->children - not working either... But since I do not want to restrict myself only to /browse/ I thought to use page parent. So this static path is working. <?php $navigation = $pages->find("parent=/browse/");?> $page->prev($navigation)->url - EDIT - stupid!!! I forgot, in my old code - I used echo strings : echo "<div><a href='$page->prev($navigation)->url'>Link here</a></div>"; This time I used <a href="<php $page->prev($navigation)->url;?>" (without echo)... Sorry all, thought suddenly something was wrong with my PW. 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