We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11413
    • 203 Posts
    Is it possible to put the content of a document in another one? Also, how to load document informations in a snippet? the document object do the job for the current document, but how to fetch external data ?

    thansk in advance,

    Blaise Bernier
      Blaise Bernier

      www.medialdesign.com - Solutions for small business, hosting, design and more!
      • 27376
      • 576 Posts
      Quote from: grunt_lord at Jan 12, 2007, 11:56 PM

      Is it possible to put the content of a document in another one? Also, how to load document informations in a snippet? the document object do the job for the current document, but how to fetch external data?

      Accomplishing any one of these will be possible through the use of a snippet, I’d recommend looking in to the getDocumentObject function for a solution.
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You can also use a TV with the @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
          • 27376
          • 576 Posts
          Quote from: sottwell at Jan 13, 2007, 03:35 AM

          You can also use a TV with the @DOCUMENT binding.

          Gah... I always forget about TVs, those would work better for including a document in another document wink
            • 11413
            • 203 Posts
            Thanks a lot for reminding me that there was a binding for that! Sadly in the current situation, I would prefer to include the documents with a snippet because I got many documents to include at many places, and creating a TV for each of them will make things dirty (at least, in my view).

            Would you kn how to retrieve document content in a snippet to output it?

            thanks again,

            Blaise
              Blaise Bernier

              www.medialdesign.com - Solutions for small business, hosting, design and more!
              • 27376
              • 576 Posts
              Quote from: grunt_lord at Jan 13, 2007, 07:04 AM
              Would you kn how to retrieve document content in a snippet to output it?
              Try this:
              Quote from: sirlancelot at Jan 13, 2007, 03:07 AM

              Accomplishing any one of these will be possible through the use of a snippet, I’d recommend looking in to the getDocumentObject function for a solution.
                • 36541
                • 222 Posts
                Quote from: grunt_lord at Jan 13, 2007, 07:04 AM

                Would you kn how to retrieve document content in a snippet to output it?

                Try GetField.
                  This is the web: the only thing you know about who will come is that you don't know who will come.
                  • 11413
                  • 203 Posts
                  Thanks a lot for your replies! In my case, user permissions are not a problem, but I think I’ll rewrite my thing with getDocumentObject. I’m gonna look at the wiki more carefully I think! I’ll also take a look at the get field snippet just to see its features.
                    Blaise Bernier

                    www.medialdesign.com - Solutions for small business, hosting, design and more!
                    • 22303 MODX Staff
                    • 10,725 Posts
                    Hang on folks...getDocumentObject is an internal function, not an API function. It is only used by the core and should not be used by add-on developers.
                      • 27376
                      • 576 Posts
                      Quote from: OpenGeek at Jan 18, 2007, 08:53 AM

                      Hang on folks...getDocumentObject is an internal function, not an API function. It is only used by the core and should not be used by add-on developers.
                      Oops sad

                      Will there be an API Function like it in the future? As far as I can tell, there’s only one line in the [tt]getDocumentObject[/tt] function that prevents it from being a viable API Function, and that’s when it loads the TVs and uses [tt]$this->documentIdentifier[/tt] instead of the local [tt]$identifier[/tt] (version 0.9.5)

                      But I’m not a core programmer wink Thanks for the insight!