drilonb Posted May 13, 2011 Posted May 13, 2011 It's possible to make Siblings with limit, sort, i make like this works perfect but show older in top <?php echo "<ul class='menuposht'>"; foreach($page->siblings as $sibling) { $class = $page === $sibling ? " class='active'" : ''; echo "<li><a$class href='{$sibling->url}'>{$sibling->title}</a></li>"; } echo "</ul>"; for now i am using like this to sort them and limit, works nice, but i like to use sibling <?php $children = $pages->get("/puna/")->children("sort=-created, limit=3"); foreach($children as $puna) { $class = $page === $puna ? " class='active'" : ''; echo " <ul class='menuposht'> <li><a$class href='{$puna->url}'>{$puna->title}</a></li> </ul> "; } Thanks.
ryan Posted May 13, 2011 Posted May 13, 2011 This is possible. The siblings method will accept a selector just like others will: <?php echo "<ul class='menuposht'>"; foreach($page->siblings("sort=-created, limit=3") as $sibling) { $class = $page === $sibling ? " class='active'" : ''; echo "<li><a$class href='{$sibling->url}'>{$sibling->title}</a></li>"; } echo "</ul>";
drilonb Posted May 14, 2011 Author Posted May 14, 2011 This is amazing , great and biggest thanks Ryan for all support,
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