Question

I have a parent resource and say about 4 child resource (There is a need why this is setup like this and not by Template varibale or chunk) I need to get the child resources (which is simple html markup) to be shown in the parent resource can this be done.

Is there a snippet I can include in parent which has a php code which gets the contents of another Resource? Whats the way to get resource content if a specifiv resource in a snippet??

Thanks, Nikhil

Was it helpful?

Solution

You could use the Ditto snippet to show the childrens content anyway you want

[[Ditto? &parents=`your_parent_id`&tpl=`tplyourtemplatechunk`]]

And then you create a chunk that shows the info you want from your children.

<div class="something">
    <h2>[+pagetitle+]</h2>
    [+content+]
</div>

Use plus-sign instead of asterix inside the Ditto template :)

Check out Ditto here: http://wiki.modxcms.com/index.php/Ditto

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top