Jump to content

makari

Members
  • Posts

    19
  • Joined

  • Last visited

Community Answers

  1. makari's post in class='active' for the parent li-element was marked as the answer   
    Thank you. 
    I've tried it with
    $node->children->has($page) looks very good but it dit not work. (in the _main.php template) Don't know why.
    So I build it my own way.
    May be not elegant, but it works.
    <nav class="PV" id="navigation"><ul> <!-- top navigation --> <?php foreach($homepage->and($homepage->children) as $item){ if($item->name=='site-map') continue; // hide site-map if($item->id==$page->rootParent->id){ echo $page->id==$item->id ? "<li class='active'>" : "<li>"; } else { echo "<li>"; } echo "<a href='$item->url'>$item->title</a>"; if($item->name == 'home'){ echo "</li>"; continue; // don't open the children if homepage } if($item->numChildren(true) && $item->id == $page->rootParent->id) { echo "<ul>"; foreach($item->children as $sub_item) { echo $page->id==$sub_item->id ? "<li class='active'>" : "<li>"; echo "<a href='$sub_item->url'>$sub_item->title</a></li>"; } echo "</ul>"; } echo "</li>"; } // output an "Edit" link if this page happens to be editable by the current user if($page->editable()) echo "<li class='edit'><a href='$page->editUrl'>Edit</a></li>"; ?> </ul></nav> Thank you again. Whether I use you suggestions or not - your feedback is allways important for me to find the point.
    Matthias
  2. makari's post in sort=-date – without any effect was marked as the answer   
    long version:
    Now I use a Field named 'featured' with type 'Page' on the frontpage template - so the custumer can combine a set of featured objects on one place...
    foreach($page->featured->sort("-created") as $Objekt) { ... ; }
×
×
  • Create New...