We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36549
    • 572 Posts
    Hi,
    I have a template with a vertical navigation that uses wayfinder and works just fine.
    I also have a top navigation comprising 5 links...what’s the best way to include this into the site?
    Each of the top links has an ’active’ state and so i need to add this class to each of the five pages, but do i have to create 5 tv’s and add the tv variable name to each of the pages i create i.e. {*home*}, {*about*}?
    ...in which case how do i lock down that part of the page so the client doesn’t accidently delete it, or is there a better way to do this?

    Can post code if it helps?

    Thanks for any help

    J
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 7231
      • 4,205 Posts
      You can add as many wayfinder calls as needed. Just place them where you want them to show in the template.

      As for the TVs, I don’t think that wayfinder handles TV values (I could be wrong). The ’normal’ way to name the links is to used the pagetitle, longtitle or the menutitle document variables for each document.

      how do i lock down that part of the page so the client doesn’t accidently delete it, or is there a better way to do this?
      You can restrict a TV to only be edited by a particular group.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 36549
        • 572 Posts
        Hi,

        Thanks for your quick response.
        So i can add 2 lots of wayfinder calls like this (in it’s most basic form)...
        [[Wayfinder? &startId=`0’]] - so this would be for the 5 top links.
        [[Wayfinder? &startId=`5’]] - this would be for the vertical menu.
        Is that correct?...because it just doesn’t seem to work for me. Both menus disappear and i’ve tried duplicating the wayfinder snippet and renaming ’wayfinder2’...but still no menus appear!!!


        ..and is the class of ’active’ that wayfinder recognises or is it ’current’?

        Thanks for your help
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          It looks like you have single quotes instead of backticks. It should be
          [[Wayfinder? &startId=`0`]]

          etc...
            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
            • 7231
            • 4,205 Posts
            Backticks for sure! Also make sure that all pages are published and that they are accessible.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 36549
              • 572 Posts
              Hi,

              Thanks once again for getting back to me.

              I’ve looked at the code, changed the backticks and still the menus do not show.
              However, i am wondering if it has something to do with having spans in the top menu...
              #nav ul {
              display: block;
              float: right;
              height: 25px;
              list-style: none;
              margin: 81px 0 0;
              padding: 0;
              }
              #nav ul li {
              display: inline;
              float: left;
              margin: 0 0 0 2px;
              }
              #nav ul li a {
              background: url(images/nav-tab.gif) no-repeat 0px 0px;
              display: block;
              height: 25px;
              width: 90px;
              }
              #nav ul li a span {
              cursor: pointer;
              display: block;
              font-size: 11px;
              font-weight: bold;
              height: 25px;
              line-height: 25px;
              text-align: center;
              width: 90px;
              }
              #nav ul li a:hover,
              #nav ul li.active a {
              background-position: 0px -25px;
              color: #fff;
              }
              #nav ul li.active a span {
              background: url(images/nav-arrow.gif) no-repeat top center;
              }

              ...because this isn’t a straight unordered list does it mean i need to add a chunk to the wayfinder call?

              thanks again for taking the time...very much appreciated.
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 7231
                • 4,205 Posts
                ...because this isn’t a straight unordered list does it mean i need to add a chunk to the wayfinder call?
                Yes, you need to build the custom template chunk to build the menu you want. The standard is an unordered list. However this should display something even if wrong. Please post the entire wayfinder call.

                Check out all the wayfinder parameters at:
                http://www.muddydogpaws.com/development/wayfinder/parameters.html
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don't know what it is.
                  Do you, Mr. Jones? - [bob dylan]
                  • 36549
                  • 572 Posts
                  Hi,

                  The wayfinder calls that i am using are the most basic just so i could get the menus displaying first off, so all i’m using is:

                  <div id="nav"> [[Wayfinder? &startId=`0`]] </div> - top menu
                  [[Wayfinder? &startId=`5`]] - vertical menu (this one is just placed within the first part of a sidebar div)

                  It is just the top menu that doesn’t display, the html is:
                  <ul>
                  <li class="active"><a href="#"><span>Home</span></a></li>
                  <li><a href="#"><span>About</span></a></li>
                  <li><a href="#"><span>News</span></a></li>
                  <li><a href="#"><span>Links</span></a></li>
                  <li><a href="#"><span>Contacts</span></a></li>
                  </ul>

                  ...but i think it may be like you say and i have to find which chunk to add to include the span to the default...
                  I’ve tried this??
                  <li[+wf.classes+]>
                  <span><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></span>
                  </li>

                  ..with the call of &rowTpl, but it still doesn’t work.

                  I thought i’d got it....what am i doing wrong?:-(

                  thank you.
                    www.9thwave.co.uk
                       WEB | DESIGN | PRINT
                    • 10449
                    • 956 Posts
                    What happens if you clear the cache, or use uncached calls? [!Wayfinder!]
                    Also try adding &debug=`true` temporarily to each call.
                      • 36549
                      • 572 Posts
                      Hi Ganesh,

                      Hmmm...that doesn’t appear to work either.

                      Is my wayfinder call correct:
                      I have a chunk called topNav:
                      <li[+wf.classes+]>
                      <span><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a></span>
                      </li>
                      call:
                      [!Wayfinder? &startId=`0`&rowTpl=`topNav`!]
                        www.9thwave.co.uk
                           WEB | DESIGN | PRINT