We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8037
    • 10 Posts
    Ok, so here’s what I want to do; I want wayfinder to output a single link for one page with the ID 3. Sounds easy right, thats what I thought... I do have to ad that I’m a MODx n00b. I have been trying to figure out WayFinder and thought I was making some progress, apparently I was mistaken.

    Here is the snippit call;
    [[Wayfinder? &startId=`0` &rowTpl=`MenuBlogEntry` &includeDocs=`3`]]

    and the MenuBlogEntry chunk;
    <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>

    The output I was looking for was something like this (easy right?);
    <a href="[~3~]" title="Ad Blog">Ad Blog Entry</a>

    Some help would be apreciated, thanx

    Drew
      • 10449
      • 956 Posts
      Well, that should work. Weird. Maybe use uncacheable syntax with [!!] and clear cache in the manager?

      [!Wayfinder? &startId=`0` &rowTpl=`MenuBlogEntry` &includeDocs=`3`!]



        • 8037
        • 10 Posts
        Doesn’t work either, the output is still nothing, just an empty line in the html.

        Maybe I must add that the document with ID 3 is a document only vieweble by a loged in siteadmin, the link should only show up if you view the site as a siteadmin. But it also doesn’t work if I make the document publicly vieweble. I can get to the page is I fill in the ID (index.php?id=3)

        ...an Idea?

        grtz,

        Drew
          • 7231
          • 4,205 Posts
          I tried your call and it worked fine.
          However, one thing is that by using the inner or row template the link is built in a <ul> tag. You should use the outer most template to create the link or include the <li> tags to your template.

          Here is the output I got:
          <ul><a href="/index.php?id=3" title="Page Title">Link Text</a>
          </ul> 
          


          Do you have the most current WayFinder?
            [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]
            • 8037
            • 10 Posts
            Yes, its the most resent version of Wayfinder. Its weird that it does nothing in my site, not even an error, just an empty line...I don’t get it.

            update:
            Ok, I got it to work...I still don’t really know why it works but I was trying a few things and at last for some reason something worked;
            [[Wayfinder?startId=`0` &outerTpl=`mh.OuterTpl` &innerTpl=`mh.InnerTpl` &rowTpl=`mh.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &firstClass=`first` &hereClass=``]]
            and I changed all the chunks to only say "[+wf.wrapper+]" except mh.InnerRowTpl which I changed to;
            <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]
            and this gave the desired output. Now I can probably change it more to make it a bit more logical but I’m already very happy that it’s working, and I’ve learned to apply the saying "If it aint broke then don’t fix it." lavishly...