Search code examples
modx-revolutionchunks

MODX Access page content from snipet


I have a parent page where I want to load through a chunk the content of several child pages just like in a blog roll:

Child1 content is text : Text for page Child 1

Child2 content is text : Text for page Child 2

Child3 content is text : Text for page Child 3

What I don't know is how to access the content of Child1, Child2, Child3 pages in the chunk. I tried like this [[~id_of_each_page]] but it didn't show anything.

Any thoughts on this, guys?


Solution

  • I found out the answer : I should call these snipets from the parent page :

    [[getResourceField? &id=`6` &field=`content`]]
    [[getResourceField? &id=`7` &field=`content`]]
    [[getResourceField? &id=`8` &field=`content`]]
    

    Obviously you have to get first getResourceField from extras.