Search code examples
blogsmodx

ModX: Display multiple pages on one page?


I have a ModX site and I was wondering if it is at all possible to display multiple pages (including their templates and TVs) on one page? Kind of like a blog?

If anyone could help me out that would be great!

Tnanks


Solution

  • What you're looking for is a plugin like getResources.

    It will let you loop through a list of resources like so:

    [[!getResources? &parents=`[[*id]]` &tpl=`myRowTpl`]]
    

    Where the &parents is the parent resource of the items you'd like to list out, and &tpl is the template that would be rendered.

    If you're showing TVs don't forget to use

    &includeTVs=`1` &processTVs=`1`
    

    There's tons more info on the modx docs.