Search code examples
phpwebcontent-management-systemmodx

Display the same data in two different places in Modx


I'm new to Modx but already have some experience with chunks and snippets. Still, I don't really know the best way to display the same type of resource in two different places in modx.

On my site I have "review" resources which I want to have in a slider on main page (like this) and on a dedicated reviews page (like that) with them being the same resources.

What's the best approach to solving this? Should I use Extras for this?


Solution

  • You want to use the getResources extra, in fact 99.99% of all modx sites you develop will probably use getResources.

    Basically it allows yo to grab the attributes [content, TVs, title, alias etc] of a given gresource or set of resources [that you can search and filter with the getResources call!] and display them in different types of views by defining a chunk to use as a tpl for your content.

    I use it for almost every carousel I have ever implemented [in modx]