• Parsing uncached snippet not working... [SOLVED]#

  • MentalButcher Reply #1, 10 months ago

    Reply
    The content of the document is parsed correctly (when using [*content*]), if viewed as a page, it contains these snippets:
    Uncached snippet call: [!getPrefix?main=`design`&sub=`flags`!]
    Cached snippet call: [[getPrefix?main=`design`&sub=`flags`]]


    Which means that it will come out like this:
    Uncached snippet call: new_design/images/design/icons/flags/
    
    Cached snippet call: new_design/images/design/icons/flags/


    But when I get the content through the snippet below:
    $out = $modx->documentObject['content'];
    return $out;
    

    This is the output:
    Uncached snippet call: [!getPrefix?main=`design`&sub=`flags`!]
    
    Cached snippet call: new_design/images/design/icons/flags/


  • netProphET - MODX Complete Team Reply #2, 10 months ago

    Reply
    Are you calling this snippet cached or uncached? And is the resource cacheable?
    Quote from: MentalButcher at Jul 22, 2011, 05:44 AM
    $out = $modx->documentObject['content'];
    return $out;
    



  • cyclissmo Reply #3, 10 months ago

    Reply
    I believe you need to use the $modx->getDocument function to fetch parsed content, something like so:
    $modx->getDocument($docid, 'content');


  • MentalButcher Reply #4, 9 months, 4 weeks ago

    Reply
    Apparently it works if I call the below snippet uncached, don't know why this is, but I am guessing there is some sort of procedural bug, or it is intentional that you can't call an uncached snippet if it's not cached.
    $out = $modx->documentObject['content'];
    return $out;