Jump to content

Menus in General


MateThemes
 Share

Recommended Posts

Hello everyone,

this is a general support topic. The last time I often had website templates with mega menu including images. So there this is always an advanced topic for me. I normally used ProcessMenuBuilder but this is not suitable for me anymore.

So I want to asked the community, how do you build your menus? With module or whatever.

Thanks in advance.

  • Like 1
Link to comment
Share on other sites

As in my experience the menu usually doesn't change much, except maybe for submenus, I define the navigation in the _init.php and loop through the items and children:

$homepage = pages()->get("/");
$nav = $homepage->children("template=foo|bar, sort=sort");

I try to keep the navigation connected to the page tree as close as possible.

Link to comment
Share on other sites

47 minutes ago, AndZyk said:

As in my experience the menu usually doesn't change much, except maybe for submenus, I define the navigation in the _init.php and loop through the items and children:

$homepage = pages()->get("/");
$nav = $homepage->children("template=foo|bar, sort=sort");

I try to keep the navigation connected to the page tree as close as possible.

Thank you for your reply and a code example. You are right menu isn't changed. But how you manage if the customer wants complete freedom over navigation?

15 hours ago, Zeka said:

Hi @MateThemes Usually, If I need something simple I use Repeater field with depth option, if something more advanced I use Repeater Matrix field with depth.

Thank you for your reply.

Do you have a code example? Especially how you manage mega menu with an image in the menu?

Link to comment
Share on other sites

27 minutes ago, MateThemes said:

But how you manage if the customer wants complete freedom over navigation?

If the customer only wants to control the first level, then a page reference field should be enough.

If the customer wants to control everything, then maybe a repeater with depth and page reference field should do the trick: https://processwire.com/blog/posts/pw-3.0.44-repeaters/
But I never had this case. Most clients want just rarely changes, which you can update in your code. 

  • Like 1
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...