We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22303 MODX Staff
    • 10,725 Posts
    Why is the API function $modx->getDocument($id, $fields, $published, $deleted) not sufficient? Do you need the content to be processed before being inserted, or is it being processed along with the rest of the content ok?
      • 27376
      • 576 Posts
      Hmm... well personally I don’t use either function atm wink BUT, I would imagine the [tt]getDocument()[/tt] function is too specific in the parameters, If a programmer wanted to get a document regardless of its publish state, [tt]getDocument[/tt] would have to be called twice (once for $published=1 and again for $published=0). Why not have the parser go through in one pass and retrieve the document?

      [tt]getDocumentObject[/tt] allows the programmer to access the document anyway he/she pleases regardless of publish state, or any other variable that might otherwise make the document unavailable to [tt]getDocument[/tt].

      Solution 1 - Make available the [tt]getDocumentObject[/tt] as an API Function

      Solution 2 - Change [tt]getDocument[/tt] to behave more like getDocumentObject, such as making optional parameters (eg $published) not included in the query, so that if $published is not set, the document will not be selected by its publish state.

      </rant>

      Again, I don’t use either of these functions so people who DO use it may like it the way it is. This is just my suggestion. Either way, MODx is an amazing app and I’ll continue to use it no matter what smiley
        • 11413
        • 203 Posts
        Quote from: sirlancelot at Jan 22, 2007, 10:56 AM

        Either way, MODx is an amazing app and I’ll continue to use it no matter what smiley

        Sure! mODx answer all my needs and even more! I have a Ruby on rail server on my host and with snippets and/or modules, it’s easy to integrate RoR apps directly in a MODx website! I didn’t learned ruby yet, but I plan to do so in the next summer, if I have some free time tongue
          Blaise Bernier

          www.medialdesign.com - Solutions for small business, hosting, design and more!