We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6841
    • 61 Posts
    Is it possible to set up a DropMenu such that the folder I use as the startDoc is rendered as a link in the menu? The default (and maybe the only) behavior is that the startDoc folder/doc is not rendered--only it’s children.

    Say I have the following document structure...

    Folder1 ( 1 )
    - Doc1 ( 2 )
    - Doc2 ( 3 )
    - Doc3 ( 4 )
    Folder2 ( 5 )
    - Doc4 ( 6 )
    - Doc5 ( 7 )
    Doc6 ( 8 )  //notice that this one is at the site root level
    Doc7 ( 9 )  //notice that this one is at the site root level

    Can I set up a DropMenu with a startDoc of "1" but make it so that "Folder1" appears in the menu with Doc1, Doc2, and Doc3 as <li>’s underneath it?

    If it’s not possible now, has this ever been proposed or considered as a future enhancement?

    EDIT: I just realized that startID is for NewsListing while startDoc is for DropMenu. I had it correct in the code for my site, but I was getting them mixed up as I typed.
      Dave
      • 6841
      • 61 Posts
      I guess another way to accomplish the same thing would be to allow DropMenu to have some sort of filter so that I could have startDoc be "0" but tell it to filter so that only "Folder1" is displayed.
        Dave
        • 1774
        • 34 Posts
        I’m pretty new to Modx, but I don’t think that this is (currently) possible. My working solution is to create a TV that contains the link for the start doc foloder and set the default value of it to an @INHERIT binding. So then I only have to set the link for the top most folder.

        In other words:

        template looks like this:
        	<div id="sidebar">
        		<ul>
        
        			<li id="dropmenu">
                                <ul><li>[*SubMenuHeader*]</li></ul>
        			[!DropMenu?levelLimit=2&startDoc=[[UltimateParent]]!]
        			</li>
                            
                                <li id="feeds">
                                [*RecentArticles*]
                                </li>
        
        		</ul>
        


        and my template variable called [*SubMenuHeader*] is a simple text variable with the default value set to the following:

        @INHERIT <a href="index.php?id=15">Symposium</a>


        Then I just change the template variable for each top level folder and leave it blank on the sub pages.

        Hope that helps!

        I would love to see this option built into DropMenu!
          Brandon Booth
          Freelance MODx specialist for hire: site construction, template conversion, snippet customization.
          Lucidgreen.net Websites made simple.