We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13137
    • 204 Posts
    I would like to set up a page that would hold content from other pages, probably using mootabs or some other sort of tabbed option with Ajax or dhtml.
    The idea would be having something like:
    +[ ] My page (4)
    [ ] Child A (5)
    [ ] Child B (6)
    [ ] Child C (7)

    Where ID 2 could display the children in tabs.

    My problem, since php includes dont work form me, I dont know how to include the references to these pages. [~5~] or index.php?id=5 or how would I go about doing this?

    I understand that the children would not have templates because they would be inside another page.
      • 10449
      • 956 Posts
      Use Ditto:
      [!Ditto? &startID=`4` &tpl=`tabContent` &display=`3`!]


      Create a chunk named "tabContent":
      [+content+]


      And there you go.
        • 13137
        • 204 Posts
        OK, that works great.

        But, when the info is displayed, it doesn’t seem to be inheriting the formatting of the styles in the page.
        It is just rendered as plain text and goes flowing off the page.
        I looked to see if the divs end before the new section renders, but everything looks fine.
        I also tried to add <div class="post"> in the chunk, but still nothing.

        What am I missing?
          • 10449
          • 956 Posts
          Without seeing the pages, it’s hard to say. Maybe the page-styles are defined in another template? Maybe the enclosing div-tag is in the template instead of the content-area?
            • 13137
            • 204 Posts
            OK, here is what I am doing or doing wrong. I am trying this out on a localhost, so I provide a link, but I will try to explain what I did.

            I have a default install, which I created a new Chunk with the name "tabContent" and containing only [+content+]

            I then pasted the Ditto call [!Ditto? &startID=`15` &tpl=`tabContent` &display=`2`!] at the bottom of ID1 (Welcome to MODx)

            When I go to the home page, it displays as normal until the new section showing the two new areas, which show no formatting. At the end of those, formatting resumes. When I check the source, I see no closing divs befroe the new Ditto call.

            You can see in the screen capture, the text flows off the page and seems to have default font as apposed to the rest of the page.

            I dont know if this helps or not? if no, I will try to upload it tonight. Thanks for you time and help.
              • 10449
              • 956 Posts
              Well, seeing the actual HTML-output source would certainly help. It looks like your Ditto call is surrounded by <pre> or <code> tags. Turn off RTE (no WYSIWYG / tinyMCE) for that particular document.
                • 13137
                • 204 Posts
                That nailed it. Amazing that you could get that from a screen shot and bad explanation.

                Thanks for taking the time to help. It is much appreciated.