We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19948
    • 7 Posts
    only question I really have before making some templates , is the menu system.
    .home a {
    float: left; 
    display: block; 
    width: 56px; 
    height: 26px; 
    background: transparent url('images/home1double.jpg') no-repeat; 
    }
    
    .home a:hover { 
    background-position: -56px 0; 
    }
    
    
    


    if i used the above code for a button.

    then the call in the template
    <div class="home"> 
    <a href="LINK HERE">BUTTON NAME</a> 
    </div>
    
    
    
    



    how would i code it in modx so when a new resource is added , the the link goes where is says " link here" and the Menu title goes where it says button name?

    the rest i pretty much have figured out but am stuck on this part

    Thanks
    moddish
      • 8609
      • 607 Posts
      Have you looked at the Wayfinder snippet? It will allow items to be added dynamically to menu as resources are created.
        • 19948
        • 7 Posts
        yeah thats what im tring to use, but im not fimilar with altering wayfinder or how to incorporate the call to make it repeat the code above for each button.


        here is one of the templates i made that i never used commercially that i plan to convert ( removing all the branding/products)

        http://moddish.com/pages/tonon/template/

        I have a pile of them that i can upload thoe once i figure out the calls.
          • 8218
          • 2 Posts
          You need to make some Chunks to hold the list item it. Read up on the Wayfinder snippet but essentially it works like this.

          Firstly, call the Wayfinder snippet in your code where the unordered list menu item is. Delete the unordered list element completely and replace it with the Wayfinder call. It’ll look something like this:

          [!Wayfinder? &startId=`0` &outerTpl=`menuContainer` &rowTpl=`rowTemplate`!]

          Your first chunk call, the outerTpl (chunk in my admin manager is called menuContainer) would have this in it:

          <ul class="cssmenu">
          [+wf.wrapper+]
          </ul>

          Then the rowTpl calls this chunk ’rowTemplate’ which has this in it:

          <li class="middle">
          <a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
          </li>

          The CSS style sheets applied to your document can be implemented through this with classes. Your menuu should then be dynamic!