We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19943
    • 14 Posts
    If I put a simple ditto call ([!Ditto?!]) on my page, it generates the correct output. But if I try to call my custom template, I get the badtpl response ("&tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it.")

    Here’s my call:

    [!Ditto? &tpl=’cteDittoTemplateContents’!]

    And here’s the template chunk:

    <div class="ditto_item" id="ditto_item_[+id+]">
    <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
    <div class="ditto_introText">[+introtext+]</div>
    </div>


    Any ideas about what I’m doing wrong? Even if I try to call one of the default tpl chunks, it gives me the badtpl response.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You’ve got single quotes ’ instead of backticks ` in the snippet call’s parameter. So it is quite literally looking for a chunk named ’cteDittoTemplateContents’
        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
        • 19943
        • 14 Posts
        Susan--

        Thank you very much. That was it.