We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7737
    • 10 Posts
    I’m using both versions of your code. Both of which return a blank output. I think the "unauthorized access" message is because of a caching issue, which I turned off for the test page I am using.

    Is there any other way to debug what might be going on? Does MODx log output anywhere?
      • 17665
      • 54 Posts
      Well, there’s the "Event log viewer" under the Administration tab and the Audit trail. Are you calling the snippet cached or unchached ([[getDoc]] or [!getDoc!]). I need learn more about the differences between the two, but I’ve always been told to use [! !] which does not cache.

      Sorry I couldn’t be more helpful.
        • 7737
        • 10 Posts
        Well, I’ve sort of figured it out. It seems for me the getdoc function works correctly if the page does not use a tempate that has template variables. If i try to get a page the is based on a template that has template variables, it spits out a blank page.

        Oh well, back to the drawing board. Thanks again for your help!
          • 17665
          • 54 Posts
          Well, you found a pattern, but I don’t think that’s the problem. All template variables are associated with templates. So in order to use the getDoc to grab a template variable, by definition the page you are looking for has to have a template (with template variables).

          I’d look again at your template variables and the document security you have set for them. That would explain the access error you got.
            • 10940
            • 71 Posts
            First of all awesome snippet.

            Second: Im thinking of having the id as a template variable so the client could choose an id to show themselves without them going near the snippet call and having to edit the code.

            Thanks,
              • 33337
              • 3,975 Posts
              Quote from: global_1981 at Apr 29, 2009, 08:07 PM

              First of all awesome snippet.

              Second: Im thinking of having the id as a template variable so the client could choose an id to show themselves without them going near the snippet call and having to edit the code.

              Thanks,

              4 year old topic! tongue

              Use getField instead. http://modxcms.com/extras.html?view=package/view&package=173
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link