We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36426
    • 197 Posts
    Hi my website is here: http://www.scotiahouse.co.uk/

    But as you can see I’m having problems with the wayfinder buttons along the top.

    My template code has this:

    <li class="current_page_item">Home<span>

    For the page you are on, and then the rest are just standard ul’s/li’s as wayfinder outputs. Not sure how to make the current page li class to current_page_item and leave the rest alone.

    Can anyone please help, at the moment my wayfinder call is just like this:

    <li class="current_page_item">[[Wayfinder?&startId=`0` &level=`1`]]<span>

    Which I know is wrong but thought it was worth a shot...

    Any advise or help much appreciated. Thanks.
      Yorkshire UK based hosting provider: https://www.simulant.uk
      • 8609
      • 607 Posts
      Create a chunk for your rowTpl like so:

      For Revo
      <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

      or something like that.

      Then call Wayfinder like this:


      For Revolution:
      [[!Wayfinder? &startId=`0` &level=`1` &rowTpl=`the name of your chunk` &hereClass=`current_page_item`]]

        • 36426
        • 197 Posts
        Hi thanks for the help, I still can’t get it working though - I ended up with a different css template but the same sort of problem... I have used the following css:

        <ul class="bg4">
        <li class="first"><a href="#" id="menu1" accesskey="1" title="" class="link1">Homepage</a></li>
        <li><a href="#" id="menu2" accesskey="2" title="" class="link1">Articles</a></li>
        <li><a href="#" id="menu3" accesskey="3" title="" class="link1">Resources</a></li>
        <li><a href="#" id="menu4" accesskey="4" title="" class="link1">Events</a></li>
        <li><a href="#" id="menu5" accesskey="5" title="" class="link1">Contact</a></li></ul>

        I created the chunk you suggested and tried &hereClass=`link1` and &hereClass=`first` but neither of which seem to get it working right...

        thanks for any help...
          Yorkshire UK based hosting provider: https://www.simulant.uk
          • 33997
          • 150 Posts
          Please post your snippet call, as well as the code in the chunks you are calling from your snippet for a clearer view...
            "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
            • 36426
            • 197 Posts
            ok thanks... original html menu code:

            <ul class="bg4">
            <li class="first"><a href="#" id="menu1" accesskey="1" title="" class="link1">Homepage</a></li>
            <li><a href="#" id="menu2" accesskey="2" title="" class="link1">Articles</a></li>
            <li><a href="#" id="menu3" accesskey="3" title="" class="link1">Resources</a></li>
            <li><a href="#" id="menu4" accesskey="4" title="" class="link1">Events</a></li>
            <li><a href="#" id="menu5" accesskey="5" title="" class="link1">Contact</a></li></ul>

            html call at present:

            [[!Wayfinder? &startId=`0` &level=`1` &rowTpl=`scotiahousemenu` &hereClass=`link1`]]

            chunk:

            <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>
              Yorkshire UK based hosting provider: https://www.simulant.uk
              • 33997
              • 150 Posts
              I think your problem may be this: you have the ’here’ class (link1) applied to your actual a tag, but WF inputs classes where you put the [+wf.classes+] tag, hence, your ’link1’ class is ending up in your li tag, when your CSS is looking for it in your a tag. Check your output HTML to make sure I’m right, and then you can change your CSS to read for your li, or you can do the following (this is what I usually do):
              Add in this parameter to your WF call:
              &hereTpl=`yourchunkname`

              and add this chunk:
              <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]] class="link1">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

              Personally, I don’t use links for the ’here’ tag, as that is bad SEO - don’t link to the page you are on. I either put in a class="current" to the li, or I wrap the button in a span tag, then use CSS to style accordingly. Hope that helps!
                "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                • 36426
                • 197 Posts
                Quote from: goonz at Mar 03, 2011, 11:07 PM

                I think your problem may be this: you have the ’here’ class (link1) applied to your actual a tag, but WF inputs classes where you put the [+wf.classes+] tag, hence, your ’link1’ class is ending up in your li tag, when your CSS is looking for it in your a tag. Check your output HTML to make sure I’m right, and then you can change your CSS to read for your li, or you can do the following (this is what I usually do):
                Add in this parameter to your WF call:
                &hereTpl=`yourchunkname`

                and add this chunk:
                <li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]] class="link1">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

                Personally, I don’t use links for the ’here’ tag, as that is bad SEO - don’t link to the page you are on. I either put in a class="current" to the li, or I wrap the button in a span tag, then use CSS to style accordingly. Hope that helps!
                Hi thanks for the reply. I’m still a bit confused with this, should my call have your chunk and the one from the earlier post in that I set up also? This didn’t seem to work when I added it in. So I removed the other chunk and just tried yours with this call: [[!Wayfinder? &startId=`0` &level=`1` &hereTpl=`scotiahousemenu`]]

                Now I’m just making a mess!! Sorry and thanks for your patience, would posting my css help?
                  Yorkshire UK based hosting provider: https://www.simulant.uk
                  • 33997
                  • 150 Posts
                  Yes, it should have both chunks. rowTpl defined as your original chunk, and hereTpl defined as this other chunk. What this does is makes 2 different templates for how your link is made. rowTpl chunk defines how your regular old link looks like; hereTpl defines how your link looks like when the visitor is on the actual page. I missed where you put in the code for the link to be active...

                  What would you like the HTML for your ’here’ link to look like? Put this in your ’hereTpl’ chunk.

                  What would you like the HTML for your ’regular’ link to look like? Put this in your ’rowTpl’ chunk.

                  Additionally, you can have wayfinder put specific id’s on each link item like you have. Check the wiki: http://wiki.modxcms.com/index.php/Wayfinder
                  You may also find some help in the eBook: http://modxcms.com/forums/index.php/topic,34176.0.html
                    "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein
                    • 36426
                    • 197 Posts
                    <ul class="bg4">
                    <li class="first"><a href="#" id="menu1" accesskey="1" title="" class="link1">Homepage</a></li>
                    <li><a href="#" id="menu2" accesskey="2" title="" class="link1">Articles</a></li>
                    <li><a href="#" id="menu3" accesskey="3" title="" class="link1">Resources</a></li>
                    <li><a href="#" id="menu4" accesskey="4" title="" class="link1">Events</a></li>
                    <li><a href="#" id="menu5" accesskey="5" title="" class="link1">Contact</a></li></ul>

                    The above was my original .html code... which all looked good, my problem is I wanted to change the pages through modx and update the menus without haveing to manually put them in the template which is why I’m trying to convert this. I have both chunks in place but do I need the accesskey parameter 1-5, is that why it’s still not looking right? Thanks again for helping...
                      Yorkshire UK based hosting provider: https://www.simulant.uk
                      • 33997
                      • 150 Posts
                      Can you show me what Wayfinder is spitting out, and tell me which page it is on?
                        "Great spirits have always encountered violent opposition from mediocre minds." -Albert Einstein