We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21978
    • 59 Posts
    Hello, I’m a little new to modx so sorry for my lack of knowledge. I’m trying to do the following thing:
    1. Let’s say the structure of my site is like this:
    Level1
    Level2
    Level3
    2. Menu on the left shows only first two levels.
    3. On the third level there are small pages for which I use TVs to "templarize" the content. Each page on this level looks like this:
    [*book_image*] [*book_title*]
    [*book_author*]
    [*book_description*]
    So there is an "image" TV or choosing image of the book, two "input" TVs for inserting bok title and author and a rich-text field for putting the description of the book.
    This works fine but the problem is...
    4. I’d like to show the content of all those third-level pages on the page which is on the second level of my structure. How to do that? To explain a little bit more: how to render the content of all subpages (keeping in mind the context of their TVs) within their parent page?

    I managed to do something like this: I defined "page15" TV which has a value of "@ DOCUMENT 15" TV which shows the content of page with ID=15 and inserted this TV in the content of parent page. But the problems are:
    1. I would have to define a separate TV for each subpage - page15, page16, page17, .... and so on
    2. template variables which are in the content of subpages are rendered not withing the context of those subpages, but withing the context of the parent page and the values are wrong.

    Can anybody help me to resolve this issue?

    Thanks a lot.
    Grzegorz



      • 11975
      • 2,542 Posts
      You have to use ditto snippet to display the third level documents from the second.

      Take a look at the documentation => http://modxcms.com/ditto_documentation.html

      You can download it here => http://www.modxcms.com/Ditto-487.html

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 21978
        • 59 Posts
        Thanks a lot. That surely helped!
        Grzegorz