• DEVHIDE
    • Home (current)
    • About
    • Contact
    • Cookie
    • Home (current)
    • About
    • Contact
    • Cookie
    • Disclaimer
    • Privacy
    • TOS
    Login Or Sign up

    Create a Bootstrap menu with WayFinder

    1.1k Views Asked by AudioBubble At 09 September 2016 at 17:07 2025-12-20T14:46:02.496000

    Trying to create a Bootstrap menu with WayFinder. How to finish it?

    <ul class="nav navbar-nav">
       <li class="dropdown">
          <a href="#" class="dropdown-toggle" id="drop1" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Dropdown <span class="caret"></span> </a> 
          <ul class="dropdown-menu" aria-labelledby="drop1">
             <li><a href="#">Action</a></li>
             <li><a href="#">Another action</a></li>
             <li><a href="#">Something else here</a></li>
             <li role="separator" class="divider"></li>
             <li><a href="#">Separated link</a></li>
          </ul>
       </li>
       <li class="dropdown">
          <a href="#" class="dropdown-toggle" id="drop2" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> Dropdown <span class="caret"></span> </a> 
          <ul class="dropdown-menu" aria-labelledby="drop2">
             <li><a href="#">Action</a></li>
             <li><a href="#">Another action</a></li>
             <li><a href="#">Something else here</a></li>
             <li role="separator" class="divider"></li>
             <li><a href="#">Separated link</a></li>
          </ul>
       </li>
    </ul>

    My WayFinder call so far:

    [[Wayfinder? &startId=`0` &level=`1`
                                   &hideSubMenus=`TRUE` &includeDocs=`1,2,3,4,5,55,7,8,74`
                                   &outerTpl=`chunk_navigation-menu`]]
    

    And my chunk_navigation-menu looks like this: <ul class="navbar-nav nav">[+wf.wrapper+]</ul>

    modx modx-evolution wayfinder
    Original Q&A
    1

    There are 1 best solutions below

    1
    Daniel M. Melo Daniel M. Melo On 10 September 2016 at 18:42 BEST ANSWER

    First of all, I am assuming you are using MODX Evolution.

    The easiest way to do that is using

    &outerClass
    &parentClass
    &innerClass
    &parentRowTpl
    

    In your Wayfinder call.

    It should look like this:

    [[Wayfinder? &startId=`[(site_start)]` &level=`2` &outerClass=`nav navbar-nav` &parentClass=`dropdown` &innerClass=`dropdown-menu` &parentRowTpl=`navbar_parentRowTpl`]]
    

    Note: If you don't use [(site_start)] in your context(s), replace it with your menu's parent resource ID.

    Also in this case you would have to create the navbar_parentRowTpl. This chunk should look like this:

    <li[+wf.id+][+wf.classes+] class="dropdown" id="menu[+id+]">
    <a class="dropdown-toggle" data-toggle="dropdown" data-target="#menu[+id+]" href="[+wf.link+]" title="[+wf.title+]">
        [+wf.linktext+]
        <b class="caret"></b>
    </a>
    [+wf.wrapper+]</li>
    

    As it's been a long time I don't work with Evo, if there is some problem with this code let me know and I can help you.

    I used this example as reference: https://gist.github.com/mkay/f0afc97ec1536932e0a3

    And used this table to convert to the Evo syntax:

    https://rtfm.modx.com/revolution/2.x/making-sites-with-modx/tag-syntax

    Related Questions in MODX

    • MODx Create dynamic frontend page / display manager page without login
    • How to get a list of all user groups in Modx Revolution
    • MODx template variable image make downloadable
    • preg_replace not working in snippet
    • How to name a volume using a docker-compose.yml file?
    • Send Mail from MODx Template
    • How to debug modx, which snippets, processors etc were called
    • how to use conditional output filter for date field
    • Wayfinder closing tags
    • What is causing this modx error?
    • Proper way to perform AJAX request from MODx CMP (Custom Manager Page)
    • Group 'input option values' in template variable with 'listbox' type
    • Why is Modx Cloud turning my links to the cloud address whenever I preview a page?
    • New install of ModX Revo 2.2.10 - Get 'Unexpected token <:' on every manager page
    • Modx multilanguage multi site installation

    Related Questions in MODX-EVOLUTION

    • MODx template variable image make downloadable
    • preg_replace not working in snippet
    • MODx :: Get Session ID set by MODx to use in Module
    • Master Snippet to control other Dynamic Snippets
    • Modx and Ditto module: What is "parents"?
    • ModX Evo 301 redirects causing redirect loops
    • ModX Evo: Cannot create images folder
    • get preg_replace error with YAMS in Modx
    • document.mutate.save is undefined
    • Where is this line of code calling this method from?
    • Is it possible to turn off magic quotes without an .htaccess or a php.ini file?
    • MOD X evloution get child resource content to be placed in the parent resource
    • Modx Wayfinder, using levelClass
    • ModX: Resource Content box not appearing when editing resource
    • AJAX Search Not Showing Results

    Related Questions in WAYFINDER

    • Wayfinder closing tags
    • ModX wayfinder - works on some pages but not on others
    • How can I get Babel and WayFinder working with different contexts and unique startids?
    • Wayfinder: Display the Resources that are "under" another Resource with Wayfinder
    • Filter resources by template variable value with MODx Wayfinder
    • ModX wont work without absolute paths
    • MODx Wayfinder &level=2 exclude ALL but one
    • Wayfinder not respecting &level=`0`?
    • MODX Revolution Wayfinder return empty line
    • wayfinder printing class as content in accordion
    • Wayfinder includeDocs only showing first level reasources
    • Wayfinder IncludeDocs parameter in Modx is breaking the snippet
    • Wayfinder not working on new Evo install
    • html / css dropdown menu not dropping
    • Menu with div inside on ModX

    Trending Questions

    • UIImageView Frame Doesn't Reflect Constraints
    • Is it possible to use adb commands to click on a view by finding its ID?
    • How to create a new web character symbol recognizable by html/javascript?
    • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
    • Heap Gives Page Fault
    • Connect ffmpeg to Visual Studio 2008
    • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
    • How to avoid default initialization of objects in std::vector?
    • second argument of the command line arguments in a format other than char** argv or char* argv[]
    • How to improve efficiency of algorithm which generates next lexicographic permutation?
    • Navigating to the another actvity app getting crash in android
    • How to read the particular message format in android and store in sqlite database?
    • Resetting inventory status after order is cancelled
    • Efficiently compute powers of X in SSE/AVX
    • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

    Popular # Hahtags

    javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

    Popular Questions

    • How do I undo the most recent local commits in Git?
    • How can I remove a specific item from an array in JavaScript?
    • How do I delete a Git branch locally and remotely?
    • Find all files containing a specific text (string) on Linux?
    • How do I revert a Git repository to a previous commit?
    • How do I create an HTML button that acts like a link?
    • How do I check out a remote Git branch?
    • How do I force "git pull" to overwrite local files?
    • How do I list all files of a directory?
    • How to check whether a string contains a substring in JavaScript?
    • How do I redirect to another webpage?
    • How can I iterate over rows in a Pandas DataFrame?
    • How do I convert a String to an int in Java?
    • Does Python have a string 'contains' substring method?
    • How do I check if a string contains a specific word?
    .

    Copyright © 2021 Jogjafile Inc.

    • Disclaimer
    • Privacy
    • TOS
    • Homegardensmart
    • Math
    • Aftereffectstemplates