Jump to content

regarding generation of top navigation menu


adrianmak
 Share

Recommended Posts

I'm learning pw from studying bundle pw's default profile.

In the default profile, the top navigation menu will be generated by getting all children pages from the root.

Problem arised. On most of websites, there are only four to five menu items.

Let says, Home, Product, Support, About us, Contact

With using the code in default profile, all children pages add from the root will be shown on the top navigation menu. Obviously, it is not I want to.

Link to comment
Share on other sites

If I understand your question correctly, one option I often use is to have another template for pages that shouldn't be in the main menu. So the main menu selector might be "parent='/',template=basic-page" (showing the pages you mention) and another "parent='/',template=info-page" for a footer menu (Privacy Policy, Cookies etc).

  • Like 1
Link to comment
Share on other sites

Some possibilities out of millions :)

  • You can set the page to hidden and it won't appear
  • Don't generate your main menu dynamically
  • Create a checkbox field "Display in MainMenu" and only show pages that have checked it
  • Create a checkbox field "Don't display in MainMenu" and don't show pages that have checked it
  • ....

Cheers

  • Like 1
Link to comment
Share on other sites

Check the renderNav there's a $depth argument this states if it should allow recursions or not.

I don't think the TS meant depth but more how to show certain items on the same level and some not.

Wanze's suggestions covers most options but i think you could also use a page field to select your menu items.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...