We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30511
    • 8 Posts
    Hi,
    I am trying to generate a list of links to anchors (<a>) on a page generated by ditto.
    each ditto-item already has an anchor-tag, and its generating properly, but i don’t want wayfinder to output links to the respective ids, but rather to those anchors to make browsing easier.

    does anyone have a solution for this?
      • 15871
      • 105 Posts
      Hi tpy.

      I did this here: http://thehf.org/grant-faqs.html
      All FAQs are documents listed under the "Grant FAQs" folder in the manager - so the client can add, sort and delete as they see fit. Pf course, there are CSS classes associated with these, but you get the point.

      <!--Link list-->
      <DIV class="callout">[[Wayfinder? &outerTpl=`faq.OuterTpl` &rowTpl=`faq.RowTpl` ]]</DIV>
      <!--FAQs-->
      <P>[!Ditto? &tpl=`tpl.item.faq` &display=`all` &sortBy=`menuindex` &sortDir=`ASC`!]</P>
      


      Here’s the code for the template chunks:
      faq.OuterTpl
        <ol class="faq">
          [+wf.wrapper+]
        </ol>

      faq.RowTpl
      <li><a href="[~[*id*]~]#[+wf.title+]" title="[+wf.title+]">[+wf.linktext+]</a></li>

      tpl.item.faq
      <a name="[+title+]"></a>
      <h3>[+title+]</h3>
      [+content+]
      <div class="linesep"></div>
      
        • 16183
        • 1,390 Posts
        @killorbytes

        Nice one! Thx for sharing....how difficult would it be to implement a "go back up" button?

        Very nice site, btw, I like it grin

        cheers/k
          • 15871
          • 105 Posts
          @tpy

          Thanks smiley

          A back to top would be easy. Just put the anchor at the top of the page (A NAME="top" for instance) and add the link into the chunk used for the Ditto call.

          <!--tpl.item.faq-->
          <a name="[+title+]"></a>
          <h3>[+title+]</h3>
          [+content+]
          <a href="#top" class="back2top">Back to top</a>
          <div class="linesep"></div>