We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22338
    • 18 Posts
    I have something like this:
     <ul >
         <li><a href="#">MB 25</a></li>
          <li><a href="#">MB 26</a></li>
          <li><a href="#">MO 20</a></li>
    </ul>
    


    I need to put class="active" on MB 25 OR MB 26 or MO 20.
    so the chunk will be something like this
    <li><a href="[~[+id+]~]" [+[*id*]:eq=[+id+]:then=`class="active"`+] >[+pagetitle+]</li>
    


    where [+id+] is every page id and [*id*] is the current page (I read it on a topic).

    Is this possible?
    Thanks
      • 16278
      • 928 Posts
      Try the &tplCurrentDocument parameter (see http://www.pogwatch.com/ditto/ditto-templates-positional.html)

      For instance, I use it in the sidebar navigation for individual posts on the Pogwatch blog:
      [!Ditto? &parents=`2` &orderBy=`pkDate DESC` &display=`12` &tplCurrentDocument=`blog.current` &tpl=`blog.navStrip` !]

      The blog.navStrip tpl chunk:
      <div class="blogArchive"><span>[+pkDate:date=`%d %b %y`+]</span>
      <h4><a href="[~[+id+]~]" title="[+longtitle+]">[+title+] ([[Jot?action=`count-comments` &docid=`[+id+]`]])</a></h4></div>

      and the blog.current tpl chunk:
      <div class="blogArchive"><span>[+pkDate:date=`%d %b %y`+]</span>
      <h4> [+title+]</h4></div>
      

      smiley KP
        • 22338
        • 18 Posts
        Thankyou so much for giving me that idea.

        This discussion is closed to further replies. Keep calm and carry on.