Search the Community
Showing results for tags 'menu'.
-
Hello everyone, I'm trying to make a custom menu where I need to create a placeholder (drop down) for specific pages but I would like to make this dynamic, so I wouldn't need to edit the navigation file everytime there's a change. Basically something like this: Home Page A Page B Page C Page D Page E Page F Page G To this: Home Page A Page B Placeholder (not a real page) |----Page C |----Page D |----Page E |----Page F Page G I can acces the specific pages through a hidden field, I check for its existence. I know it's possible to create a new Page dynamically but can you add children to it without saving it? I could go for recursion but then almost every other page has children but I don't need them to show up in the menu. I may be complicating something but I don't know, so any help is welcomed! Thank you.
-
I'm creating a menu for a site, I need to take pages url and title as follows STUDENTS MALE PETER JACOB ALDO FEMALE ANNA FRANCESCA I need to take up the third child 1st node STUDENTS 2nd node MALE/FEMALE 3rd node PETER/JACOB... if u use this code $sc = $pages->get("/students/"); $children = $sc->children; echo '<ul>'; foreach($children as $child) { $child === $page->rootParent; echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; } echo '</ul>'; I obtain MALE/FEMALE, how I can take PETER/JACOB and others??? thank u
-
Greetings all, I am trying to separate which pages display on the header menu and those which appear on footer menu. For that I created two checkbox fields, applied them to the templates, and now I am trying to filter them in the menu list. Here's my code: <?php [b]$homepage = $pages->get("/")->find("visibility_in_top_menu=1");[/b] $children = $homepage->children; // $children->prepend($homepage); $i = count($children)-1; foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; if($i>0){echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>";} else {echo "<li><a$class href='{$child->url}' id='last'>{$child->title}</a></li>";} $i-=1; } ?> The thing is that I am probably not setting up the first line well. Can anybody help me out? Thanks!