This should definitely work.
Here’s the $default tpl created in the Ditto constructor:
$default = '@CODE<div class="ditto_item" id="ditto_item_[[+id]]">
<h3 class="ditto_pageTitle"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
<div class="ditto_documentInfo">by <strong>[[+author]]</strong> on [[+date]]</div>
<div class="ditto_introText">[[+introtext]]</div>
</div>';
In the Ditto Template class, it looks like the colon is optional:
else if(substr($tpl, 0, 6) == "@CODE:") {
$template = substr($tpl, 6);
. . .
else if(substr($tpl, 0, 5) == "@CODE") {
$template = trim(substr($tpl, 5));
Here’s the code that’s generating your error message (bad_tpl) it’s in assets/snippets/ditto/classes/template.class.inc.php:
foreach ($templates as $tplName=>$tpl) {
$check = $this->findTemplateVars($tpl);
if (is_array($check)) {
$fieldList = array_merge($check, $fieldList);
} else {
switch ($tplName) {
case "base":
$displayName = "tpl";
break;
case "default":
$displayName = "tpl";
break;
default:
$displayName = "tpl".$tplName;
break;
}
$templates[$tplName] = str_replace("[+tpl+]",$displayName,$this->language["bad_tpl"]);
}
}
You could try just commenting out that last line. It looks like it will execute any time you have a template that doesn’t contain any template variables. I don’t know why.