We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8442
    • 48 Posts
    Hi there, I was wondering if someone had a good idea of how to do the following.

    I have an events listing page which currently displays all events under a certain folder, they are labeled by month e.g January, February, March etc. You get the idea.

    Currently I have it set up so that the user goes to the listings resource and changes the template depending what month they wish to display. Obviously this has created 12 extra templates where the only thing that changes is the &parents=`` number. I would like to make this dynamic rather than a manual process.

    Does anyone have any ideas, I fear this needs a custom snippet but i'm no php developer sad

    Thanks in advance

      • 3749
      • 24,544 Posts
      As always, there are a number of different ways to solve this. I think the easiest is to just put this in the geResources tag where the parent ID goes:

      &parents=`[[*parent]]`


      If you need the pagetitle of the parent resource, you can use the getReourceField snippet for that.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting