We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21279
    • 13 Posts
    Hey,
    I am trying to build the following with wayfinder:

            <ul id="subpage-buttons">
              <li id="button-process"><a href="/web_development/process">Our Process - how it works</a></li>
              <li id="button-portfolio"><a href="/web_development/portfolio">Portfolio</a></li>
              <li id="button-contact_us"><a href="/contact_us">Contact us - call 1300 858 495</a></li>
            </ul>
    

    using this rowTpl
    <li id="button-[+wf.alias+]"><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a></li>
    


    [+wf.alias+] does not exist, would it be possible to add it to the rowTpl placeholders? I’m happy to do some hacking with the right instructions

    Cheers,
    Ryan
      • 29181
      • 480 Posts
      There is probably an easier way, but try creating a text TV for each document (for this example called id_name) with "the alias" you want (button-process) and incorporate that into your tpl like this:

      <li id="[+id_name+]"><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a></li>


      I don’t know why wf.alias isn’t working, unless maybe you don’t have friendly URLs turned on? I’ve never used it.

      Hope that helps,
      Taff
        Adrian Lawley: www.adrianlawley.com
        • 21279
        • 13 Posts
        Hey,

        I have friendly urls turned on .. I inspected the snippet and there is no reference to [+wf.alias+] it’s just not implemented.

        Cheers,
        Ryan
          • 29181
          • 480 Posts
          I checked the parameters at http://www.muddydogpaws.com/development/wayfinder/parameters.html
          and it would appear that you are correct. Looks like you will need to either use a TV as I suggested or try and use the &titleOfLinks=`alias` in your snippet call and something like:
          <li id="button-[+wf.title+]"><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a></li>


            Adrian Lawley: www.adrianlawley.com
            • 7231
            • 4,205 Posts
            I had this same problem, as far as I could figure out there is no support for alias. I ended up using another parameter instead. However, it should not be too hard to make a hack as long as the alias is on the database like the title.
              [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&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 21279
              • 13 Posts
              Yes indeed .. I ended up adding it to the snippet myself. Just a couple of lines needed to be modified.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Quote from: neubreed at Aug 07, 2007, 02:46 PM

                Yes indeed .. I ended up adding it to the snippet myself. Just a couple of lines needed to be modified.
                Can you post the lines you added?
                  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
                  • 21279
                  • 13 Posts
                  Actually it was just one line in assets/snippets/wayfinder/wayfinder.inc.php

                  Line 21
                  	var $placeHolders = array(
                  		'rowLevel' => array('[+wf.wrapper+]','[+wf.classes+]','[+wf.classnames+]','[+wf.link+]','[+wf.title+]','[+wf.linktext+]','[+wf.id+]','[+wf.attributes+]','[+wf.docid+]','[+wf.introtext+]','[+wf.description+]','[+wf.subitemcount+]','[+wf.alias+]'),
                  		'wrapperLevel' => array('[+wf.wrapper+]','[+wf.classes+]','[+wf.classnames+]'),
                  		'tvs' => array(),
                  	);
                  


                  Make sure [+wf.alias+] is placed at the END of that first rowLevel array.

                  Cheers,
                  Ryan
                    • 3475
                    • 16 Posts
                    After modifying wayfinder.inc.php do you need to do anything else? It doesn’t seem to be working for me.

                    It would be nice if alias was available by default.
                      • 1611
                      • 591 Posts
                      Actually, I also can’t get it work.
                      Documentation says that I sould use [+alias+] instead of [+wf.alias+], because of alias is document field. But it also don’t work. :-(

                      Does anybody know how to use alias field in WayFinder template?