MOD X evloution get child resource content to be placed in the parent resource

StackOverflow https://stackoverflow.com/questions/7909670

  •  14-02-2021
  •  | 
  •  

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

Était-ce utile?

La 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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top