We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3177
    • 137 Posts
    bertcatsburg Reply #1, 19 years ago
    Hello,

    I am doing maintenance on a site which has a template with the following content:

    [[includer?file=`/template/mytemplate.html`]]


    This implies that there is a snippet calles ’includer’.
    But I cannot find this snippet anywhere in the system.

    Next strange thing is that when I try to use this in a new MODX environment, it gives me an error message.

    Does anybody know where this use of ’includer’ in the template comes from?

    Thanks,

    Bert Catsburg

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      There must be a snippet named "includer". Check the Resources->Manage Resources, then the Snippets tab. Is this template in use? It may have been a testing template. This method is used so the template code is in a file instead of in the database. The path would be the path to the actual HTML file being used as a template.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3177
        • 137 Posts
        Yes, there is a snippet. My previous programmer made one and I didn’t look...
        Snippet contents:

        <?php
        $root = getcwd();
        include $root.$file;
        ?>
        
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Based on the PHP function getcwd(), which can fail on some systems under certain conditions...
          http://il.php.net/getcwd
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org