We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Sounds like it’s redirecting to itself, going into a loop...or something. What does the first child have in the way of snippets, and what plugins do you have enabled?
      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
      • 10357
      • 573 Posts
      the only plugin i have is SEO Strict URLs and there are no snippets in the firstchild. Not sure if this matter but i am running modx in a sub folder and have furls on.
        • 18367
        • 834 Posts
        This snippet is so cool.

        Simple and does exactly what I want.

        Thanks cool
          Content Creator and Copywriter
          • 791
          • 46 Posts
          I just modified this snippet with JohnO’s ’last child’ hack. Works a treat. Now when selecting News from the main menu it goes to a page with the latest news item and a sub-menu of all previous articles down the side. Excellent  grin

          UPDATE:

          Since I posted this I have modified the code a little as follows:

          Find the line: $children= $modx->getActiveChildren($docid, ’menuindex’, ’ASC’);

          And I changed it to: $children= $modx->getActiveChildren($docid, ’createdon’, ’DESC’);

          Reasoning: I checked out the table modx_site_content in PHPMyAdmin to find the table’s field names. I wanted to sort by the date the document was created, not the menu index; (In my site, because I’ve added historical articles in no particular order, the document ID’s don’t necessarily run in date order). I guess I could have chosen ’pub_date’ as well for the same result.

          So, in summary, pick the DB field you want to sort by and replace ’menuindex’ with it. Choose ASC or DESC depending on which direction you want to sort.
            Learning a little more each day.