tooth-paste Posted February 6, 2017 Share Posted February 6, 2017 What is the best way to structure my pages in the back-end? I have different pages split in two different styled menu's. Three menu links of pages are bigger then the rest. Underneath the big button pages are some subpages. -page -page -page -page -page --page --page Link to comment Share on other sites More sharing options...
Robin S Posted February 6, 2017 Share Posted February 6, 2017 I suggest you structure your pages based on how the front-end URLs should be (e.g. mydomain.com/page/subpage/) rather than how you happen to be styling your menus. 1 Link to comment Share on other sites More sharing options...
tooth-paste Posted February 6, 2017 Author Share Posted February 6, 2017 The trouble is that if I place all pages in the main root, how do I output two different menu's? When I use this code all children are visible in the same styling. Must menu links be made invisible? $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); Link to comment Share on other sites More sharing options...
diogo Posted February 6, 2017 Share Posted February 6, 2017 You have many options. One is to have the pages that you don't want on the main menu as "hidden", and build the second menu by hand. Another is to make a simple menu builder, for example on the home template, with two different page fields. There are more options, but I think those two are already pretty good. 2 Link to comment Share on other sites More sharing options...
adrian Posted February 6, 2017 Share Posted February 6, 2017 Or @kongondo's menu builder: http://modules.processwire.com/modules/process-menu-builder/ 2 Link to comment Share on other sites More sharing options...
Robin S Posted February 6, 2017 Share Posted February 6, 2017 Selectors are your friend. $my_special_pages = $pages->find("parent=/, name=foo|bar|baz"); // or match by template, or anything else $my_other_pages = $pages->find("parent=/, id!=$my_special_pages"); // now build your menus from these PageArrays 4 Link to comment Share on other sites More sharing options...
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