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

    I’m trying to build a CMP. The MODx documentations mentions that the action file should serve a Smarty template like:

    return $modx->smarty->fetch( '/path/to/templates/list.tpl' );
    


    I have my tpl file in core/components/mycmp as suggested by the documentation however the error log states:

    [2010-09-15 14:38:30] (ERROR @ /Applications/MAMP/htdocs/modx/core/model/smarty/Smarty.class.php : 1092)
    User warning: Smarty error: unable to read resource...
    


    What path would I need to specify to MODx in order to find the tpl file?

    I did create a namespace pointing to the path where mycmp is located.
      MODx Revolution / MAMP / OS X
      • 28215
      • 4,149 Posts
      From line 80 of modsmarty.class.php:
      $this->modx->smarty->setTemplatePath($this->action['namespace_path']);


      Basically, the template path is whatever path you set for your Namespace path.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 27519
        • 275 Posts
        Yep, thanks. I figured it out.

        MODx actually looks in the specified namespace directory.

        It’s simple. I was making it too difficult.... grin
          MODx Revolution / MAMP / OS X