We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32699 ☆ A M B ☆
    • 427 Posts
    Quote from: KBtechnics at Aug 15, 2008, 07:57 AM

    Hi,

    can I use $modx->parsechunk using a file as template instead of a chunk?
    I tried to use the function call
    $modx->parsechunk("@file:" . $modx->config['base_path']. $this->template_path . $filename, $fields_values_array, '[+', '+]')
    

    but it returns FALSE.
    Of course,
    file_exists($modx->config['base_path']. $this->template_path . $filename) == TRUE
    

    How can I do?

    thx in advance

    You may want to make a snippet

    which could read the snippet call (the vars)
    and then include an external file with php include()

    In that file have the strings in place you ae going to insert into....
      Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

      Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      In the first place, the function is parseChunk. Case is important. In the second place, no, you cannot use it with a file, you can only use parseChunk with a chunk.
        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