We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    Is there a way to have the top level menu item visible in the navigation bar, but not link to an actual resource. My thinking is that I was users to click only on the available options in the drop menu. I only need this ability for one of my menu items.
    • &categoryTpl

      The resource to use that tpl can be set to have no template, or it can have rel="category" in its Link Attributes field.

      Usually, I use the same rowTpl as the rest, replacing the <a> tags with <span> tags and styling it in the CSS.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 19872
        • 1,078 Posts
        Thanks Susan:

        I'll give this a try.

          • 19872
          • 1,078 Posts
          If I set the template for the contain resource to blank, a page still loads on the front end with the content — but nothing else that would normally be on a template (nav menu, footer, etc.)

          If I type rel="category" in the link attributes field, a page still loads.

          Goal:

          NEIGHBORHOODS (no page)
          neighborhood 1 (page of content)
          neighborhood 2 (page of content)

          &categoryFoldersTpl = Name of the chunk containing the template for category folders. And.... this makes absolutely no sense to me. Maybe this means I need a new chunk that incorporates that top level item with children using span tags instead of a tags as you mentioned.

          This may be just a bit out of bounds for me at the moment and perhaps much quicker for me to just build a landing page for each top level item. I have my wayfinder (now pdoMenu) perfectly integrated using Foundation 5 TopBar. I'm a big fan of going with what I know works. I might need to save this for another time when am not under the pressure of a deadline. [ed. note: mmcgee last edited this post 9 years, 8 months ago.]
            • 19872
            • 1,078 Posts
            Somehow, I successfully built my Foundation 5 Top Bar navigation menu using only 2 chunks, and it works fine. Typically, I only have one level of children — no grandchildren. Perhaps if I did, I would need another chunk? Honestly — I don't fully know whether my setup is proper, but it does work.

            Wayfinder has been one of those topics – among many — that I have trouble wrapping my brain around. But, I've gotten it to where it works for what I need, so I figure – why mess with it?:)
            I seem to remember early on in my learning wayfinder, that I was creating not only the inner and outer, but also an inner row and outer row that seem to not be necessary with my current menu. Then again, perhaps that's why I'm not seeing a tags and also possibly limiting my use of the true power of wayfinder?

            I reviewed my code, and there's no place change a to span, as there are no a tags. There is an a & span tag in the title-area ul, but that is separate and unrelated to the actual navigation menu. That merely throws in the toggle bar for small and mobile display.

            Perhaps Foundation has a specific class for parent items with no link other than to open the drop menu.

            pdoMenu call:
            
            [[pdoMenu?
            &startId=`0`
            &level=`3`
            &outerTpl=`nav_ncitymain_outerTpl`
            &innerTpl=`nav_ncitymain_innerTpl`
            &outerClass=`top-bar`
            &innerClass=`dropdown`
            &parentClass=`has-dropdown`
            ]]
            
            outerTPL
            <nav [[+wf.classes]] data-topbar data-options="mobile_show_parent_link: true">
                <ul class="title-area">
                    <!-- Title Area -->
                    <li class="name"></li>
                    <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
                    <li class="toggle-topbar menu-icon">
                        <a href="#"><span>Menu</span></a>
                    </li>
                </ul>
             
                <section class="top-bar-section">
                    <ul class="left">
                        [[+wf.wrapper]]
                    </ul>
                </section>
            </nav>
            
            
            innerTPL
            <!-- nav_ncitymain_innerTpl -->
            <ul[[+wf.classes]]>
                [[+wf.wrapper]]
            </ul>
              • 19872
              • 1,078 Posts
              Hey Susan:
              Although I have a functioning menu that meets my needs, I think I may be missing out on additional options because of the simple way I have my TPLs set up. I don't expect you to solve my puzzle here, but appreciate your responding. It's certainly prompted me to view my menu setup in a new light, which is always a good thing.
              • The default rowTpl is this:
                <li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

                Your categoryFoldersTpl would looks something like this:
                <li[[+wf.id]][[+wf.classes]]><span>[[+wf.linktext]]</span>[[+wf.wrapper]]</li>

                As you can see, the <a> tags are replace with <span> tags. You'll need to style them in the CSS to match regular linking li elements with <a> tags.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 19872
                  • 1,078 Posts
                  Thank you so much for sending! I'll try this out.