Jump to content

Recommended Posts

Posted

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)...

Posted

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.

Posted

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; ?>
Posted

Or what about?

$navigation = $page->siblings;

or

$navigation = $page->parent->children;

Your both codes are the same if {$page->parent->name} returns "browse"

Posted

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.

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...