We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28180
    • 11 Posts
    I want to be able to include 1 page within another page but I am having some difficulty getting it to work.

    In the page I want to include the secondary page into I am placing [*include1*] where include1 = the template variable I have created.

    The variables I am using for include1 are:

    Variable Name: [*include1*]
    Caption:
    Description:
    Input Type: Text
    Input Option Values: @DOCUMENT 13 <--the ID of the document I want to include
    Default Value:
    Widget:


    Am I using this properly? What have I done wrong? Nothing is showing up.

    Thanks for your help!
      • 4310
      • 2,310 Posts
      Have you put your TV [*include1*] in the template that is being used for the first document?
      I’ve just tried it and it pulls through the contents of the other page correctly.
        • 28180
        • 11 Posts
        Ahh, no. I want to pull the file into another file, not into a template. Is that possible?

        I know this is what chunks are used for, but I want to be able to use the WYSWIG editor to edit the table on the page that I am trying to include on several other pages.

        Just a little background for you.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          your @DOCUMENT should be the default value, not the input option value. That is for check boxes, select drop-downs, radio buttons and the like, where the editor can pick one of the options.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28180
            • 11 Posts
            I have modified the variable, but it didn’t make a difference. I have now found a snippet that does what I need.

            http://modxcms.com/Include-Page-ID-Content-1626.html

            Thanks for your help guys!