We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10313
    • 375 Posts
    Hello,

    I’m buildung a graphical menu by using
    [!Wayfinder? &startId=`1` &includeDocs=`3,4,5,6` &level=`1` &outerClass=`bildmenue` &hereTpl=`bb_parentRowTpl` &rowTpl=`bb_rowTpl` &parentRowHereTpl=`bb_parentRowTpl`!]


    This will built an additional graphical element to show the user in wich of 4 main menu areas he is. The graphical buttons usually are gray, but when I hover or when I am in one of the 4 branches, the appropriate button would be coloured. Understanding, what I mean?

    I’m using two templates:

    bb_rowTpl is
    <li[+wf.id+][+wf.classes+]>
    	<a onmouseover="mnbtn[+wf.docid+].src='assets/images/buttons/btn-[+wf.docid+]-1.png'" onmouseout="mnbtn[+wf.docid+].src='assets/images/buttons/btn-[+wf.docid+]-0.png'" href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]><img src="assets/images/buttons/btn-[+wf.docid+]-0.png" alt="[+wf.title+]" id="mnbtn[+wf.docid+]"/></a>
        <img  src="assets/images/buttons/btn-[+wf.docid+]-1.png" alt="]" class="preload"/>
    </li>


    and bb_parentRowTpl is
    <li[+wf.id+][+wf.classes+]>
    	<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]><img src="assets/images/buttons/btn-[+wf.docid+]-1.png" alt="[+wf.title+]" /></a>
    </li>


    The rowTpl has Javascript for hover support and additionally outputs the coloured hover state image with class="preload" wich is not displayed, but the image is preloaded.

    My problem is: which WF-templates do I have to use so that my button will be coloured, whenever the current document is in one branch of my website.

    With the above settings, I only achieve that when I am on a top-level page, that image is colored, but when I go deeper in my document tree, the image is gray again.

    Any ideas very much apreciated smiley
    Martin
      • 7455
      • 2,204 Posts
      there is a active and a here state you can set the class for thet in the config or in the call

      &activeClass=`yourclassname`
      &hereClass = `yourhereclass`

      there are more classes go to yoursiteurl/assets/snippets/wayfinder/wayfinder.documentation.html
        follow me on twitter: @dimmy01
        • 10313
        • 375 Posts
        Yes, I know about the numerous classes that I can apply. But in my case, I’m using templates. I have different images for each menu item. so I cant change -- for example -- the background-image with css.
          • 7455
          • 2,204 Posts
          you can set images using css just add [+wf.docid+] placeholder to the id like id="menuitem[+wf.docid+]" then use css to set the background image for each item that way you can strip the javascript and do it all in css

          Dimmy
            follow me on twitter: @dimmy01