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

    I’m trying to use Wayfinder and Ditto together to create tabbed content. Right now I’m working on getting the <li>s that Wayfinder generates to comply with the formatting needed for the tabbed content javascript to work.

    I’ve got a Wayfinder template able to build in the javascript parameter into the <li> results. I need to create another template that is only applied to the first item in the list.

    Any ideas?

    Chris
      • 15987
      • 786 Posts
      You will want to look at the new beta version I have created. It allows you to assign a template for the first item:

      http://modxcms.com/forums/index.php/topic,33904.0.html
        • 5210
        • 43 Posts
        Hey Ryan! Thanks!

        Link to installation/update instructions?

        Chris
          • 5340
          • 1,624 Posts
          If I remember well the class "first" is added to the first element.
          You could change the name using &firstClass.
          Now you can detect the first element using javascript and reformat the html to your needs.


            • 15987
            • 786 Posts
            This is Kyle btw tongue

            I did not write up any instructions. Basically there is a zip file extract the contents into your modx folder. It will put the files in assets/snippets/wayfinder2.5 Then open the file called wayfinder2.5.snippet.php. This code should be placed into a snippet. I would create a new one so that your current wayfinder install is still usable if needed.
              • 5210
              • 43 Posts
              Oops - Sorry Kyle. embarrassed

              Hey xpix - That’s EXACTLY what I need to do, apply the "active" class to the first item. I’ll try it out!

              Thanks,

              Chris
                • 5210
                • 43 Posts
                Worked like a champ, xpix. Thanks! (Just had to remember to add [+wf.classes+] to the template)

                Now I have the Wayfinder <ul> formatted as the javascript needs it.

                Off to work on the Ditto portion...

                Chris
                  • 5210
                  • 43 Posts
                  Hey xpix,

                  Is there a similar parameter for Ditto? I’m about to look through the Ditto docs...

                  Chris
                    • 5210
                    • 43 Posts
                    There’s an &tplFirst that I can use...

                    Chris