We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6723
    • 93 Posts
    Sorry, probably obvious but can't think of the answer.

    I want to make a html link in a menu system always go to latest document in a folder for a news section. I'm using Ditto for news section but have a stand alone menu system.

    I'm using Evolution 1.0.6 on PHP 5

    Thanks, David
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use any kind of list snippet, set to order by create_date, and showing 1 result. Depending on where you want it in the menu, you'll need to have its output be the same structure as your regular menu items, and use the CSS to make sure it's a seamless fit.
        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
        • 6723
        • 93 Posts
        Thanks - brain got stuck there - a Ditto call with "&summarize=`1` and a minimal template should do it.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You can get really creative with Wayfinder templates, specifically the outerTpl that generates the outer ul tags. If your outerTpl only has the starting ul tag and the wf.wrapper placeholder, your custom insertion can use the same rowTpl as your Wayfinder menu does, as well as supply the outer closing ul tag, thus seamlessly embedding your link into the whole Wayfinder menu.

          <li [+wf.classes+]> ... </li></ul>
            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