We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37108
    • 80 Posts
    I'm working on a function that fetches a resource object and re-orders its content for output to print. Basically, there is a tv (that holds a special rich-text content area) wrapped in a chunk; that chunk is placed somewhere in the flow of the main content by the user and floats within the main content. For printing purposes, the content in this chunk needs to be taken out of the flow of the main content. Thus I need to get the main content without chunks being parsed already. getContent() or $res->get('content') fetches semi-raw content (chunks are still processed). Is there a built-in way to easily get truly raw content?
      • 3749
      • 24,544 Posts
      I think you might be confused. Either $res->get('content') or (better) $res->getContent() should get you the raw content. If you try to view that content, however, MODX will process the tags before showing it to you.

      Try writing it to a file or doing this to it before viewing:

      $ct = str_replace('[[', '[ [', $ct;


      That will disable the tags so MODX won't process them.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting