We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30670
    • 10 Posts
    Hi All,

    What I want to do is have some documents which are used by other documents (in a sidebar). I got as far as a snippet like this, but it breaks the site :-(

    <?php
    $result = '';
    
      $docid = (isset($docid))?$docid:109;
      
      $mydoc = $modx->getDocument($docid, '*', 0);
      
      //$result = $modx->outputContent(parseDocumentSource($mydoc['content']));
      
      return $result;
    ?>


    If I just include the content variable of the document, it doesn’t evaluate snippets/chunks. Does anybody know how I might achieve this?

    Cheers
    Troot
      • 22303 MODX Staff
      • 10,725 Posts
      What you are attempting to do is not possible in MODx 0.9.x, or not without a lot of work; those functions you are calling are internal and not intended for use in components. I would look into using Template Variables with the @PAGE binding instead.
        • 30670
        • 10 Posts
        Cheers for that OpenGeek, what is @Page though, I can’t see it in the documentation
          • 22303 MODX Staff
          • 10,725 Posts
          My apologies, @DOCUMENT is what I meant. This is a way to bind the content from another Document to a Template Variable for rendering in a Document that has a template with access to those Template Variables.