Neo Posted June 7, 2015 Share Posted June 7, 2015 To better understand the ProcessWire API, I built a simple Portfolio site with the following page structure: - HOME - Page A - Page B - Portfolio (lists all available items) - Category A - item a1 - item a2 - item a3 - Category B - item b1 - item b2 - item b3 - Category C - item c1 - item c2 - item c3 For the menu I am using the Markup Simple Navigation module (http://modules.processwire.com/modules/markup-simple-navigation/). Now, I would like to hide all child pages from the Portfolio page in the menu (only from the portfolio page, no other top-level menu items). Would appreciate your advice how to achieve this. Link to comment Share on other sites More sharing options...
Macrura Posted June 7, 2015 Share Posted June 7, 2015 you can exclude by template, or parent, or any other valid selector. e.g. parent!=/path/to/page/ Link to comment Share on other sites More sharing options...
mr-fan Posted June 7, 2015 Share Posted June 7, 2015 In your case with different Parents would the template option work great like: 'selector' => 'template!=item-template|cat-template', // define custom PW selector, you may sanitize values from user input so all pages with this template are excluded - parent option from macrura would work,too - but you have to add every new parent (more cathegories...and so on). - Category A - item a1 - item a2 - item a3 regards mr-fan Link to comment Share on other sites More sharing options...
Neo Posted June 7, 2015 Author Share Posted June 7, 2015 Finally used the selector option to remove all template-specific pages, in this case the categories from the portfolio: 'selector' => 'template!=portfolio-category' Thanks. 1 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