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
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) {
... ;
}