We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27194
    • 9 Posts
    Hello all you MODxers,

    How do I display the content from another page in the content section of a new page? If I create a chunk, I’m concerned that it won’t be easy for my client to edit it. Ideally, I just want the content to be duplicated so that I don’t have redundant copies that need to be kept up-to-date.

    Cheers,
    J.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use a TV with @DOCUMENT binding.
        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
        • 27194
        • 9 Posts
        Quote from: sottwell at Jan 02, 2007, 09:23 AM

        Use a TV with @DOCUMENT binding.

        Right. I’ve got a TV with @DOCUMENT as the source. That of course won’t work, because I need to specify a page after it. How do I use a TV to get a nice drop-down of all the page titles? Is there a variable which contains them all, or do I have to do an @EVAL database call?

        I’m new to MODx, and most of the tricks I’ve learned have come from the included templates. I dread to think how much uneccessary code I would have written by now if left to my own devices!

        Cheers,
        J.
          • 36541
          • 222 Posts
          IMO, you’d have to make @EVAL (or a simple snippet) to retrieve document titles and their IDs to build the list of document you need. Then, the ID chosen in the dropdown could be used in a chunk with GetField (see my sig) call to display ANY part of the document chosen.
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 27194
            • 9 Posts
            Grad,

            your GetField snippet worked beautifully, but there was an issue with the install: the actual .inc.php file was not placed in the correct location, although the other files were. it was shoved three directories down in it’s own private assets/snippets/getfield/ dir! I just moved it up the heirarchy to where MODx was expecting to find it, and deleted the extra directories.

            Many thanks for this feature!
            J.