We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28619
    • 4 Posts
    Hey everyone. This is going to be a typical beginner post - just to forewarn you. First let me start by praising the MODx development team for creating such a robust and user-friendly CMS. I’m really excited to begin using it. My first question relates to building menus. In the documentation it says:

    This is where MODx snippets come in. There are a number of menu generating snippets available to generate any kind of menu you like.

    For the time being I’m using and inquiring specifically about the menu snippet ’DropMenu’ that comes bundled with MODx. I’m just now transitioning my XHTML/CSS template into MODx and would like to use one of the menu snippets to generate my dynamic menus. Do I need to duplicate the original ’DropMenu’ snippet for each new menu I create or can this 1 snippet handle the creation of multiple menus? Also, how do I control which pages are inserted into my menu? In the ’DropMenu’ PHP code there are examples of different menus and they make use of different tags. I’m assuming I can control which pages I want included in the menu by using a tag or perhaps multiple tags?

    Also, I won’t be using text in this menu. I’d like to use background-images (in the CSS).

    Thanks,
    Mason
      • 7923
      • 4,213 Posts
      DropMenu can handle multiple menus and you don’t need to duplicate it. Snippets usually take some parameters (possibly the "tags" you are referring to) which are used to modify their output. You can have multiple snippet calls on a page and they can have different parameters (some snippets are not designed to work multiple times on a page though). Just as a side note, the more advanced successor of DropMenu, Wayfinder, is also available.

      You can control in several ways what get’s showed in your menu and what not. First, there is a "display in menu" checkbox when creating documents. Then the "menubuilders" usually takes parameter what defines where in the tree to start collecting documents, so you can define some folder in that parameter and it’s childs will be returned. And furthermore, most have parameter to define how many levels to walk through when retrieving childs. So you could have for example level limit of 1 for top menu and then have a side menu what takes the childs of the document that is selected from the topmenu.

      Then again, it would be also possible to make a TV that holds some category names for documents and when creating docs, assing the doc to certain categories. Then you could use Ditto snippet to build your menu by categories. etc..

      To use background images in the menu as the visible linktext, you would probably achieve that easiest with Wayfinder. You can make it add a unique ID for every menuitem to what you can refer in your CSS.





        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 28619
        • 4 Posts
        Thanks for your help doze. I can tell already creating the menus might be difficult for me because I have virtually no programming experience and this is my first time working with an actual CMS. I’ll be posting back with more questions, I’m sure.

        Thanks again! smiley