That's smart use of the new Revo parser, there, Bob! thx for that
What I generally do is this: i create MODx templates for all the different information types that will be used in the website. I create a snippet 'FileTemplate'
<?php
# Snippet to include files from filesystem
# [[FileTemplate? &file=`assets/templates/mytemplate/file.html`]]
if ( !isset($file) || $file== "" ) return "No file specified."; //check if there's a file given.
//Start the buffer
ob_start();
//include
include $file;
//get contents from the buffer
$ob_contents = ob_get_contents();
//and kill/delete the buffer
ob_end_clean();
//return it to MODx
return $ob_contents;
?>
In each template i reference a 'unified template' like so:
[[FileTemplate? &file=`assets/templates/dito3/unified_template.html`]]
This unified template holds the common elements.
Then I use PHX (evo, indeed)
[+phx:if=`[*template*]`:is=`5`:then=`<!-- DitoBlogPost-->{{detail_ditoblogpost_ch_stpl}}`+]
[+phx:if=`[*template*]`:is=`4`:then=`<!-- CampagneItem-->
{{detail_campagneitem_ch_stpl}}
`+]
and call the right chunks for the specific template.
This approach allows a cascade where there is one containing template file ( unified_template.html ) and where specific subtemplates are called as function of the template or a specific TV within a template ( / information types )
I think the snippet should work in revo too, and there is an 'if' snippet for Revo :
http://rtfm.modx.com/display/ADDON/If
Though perhaps in Revo you could use the template tag (which returns the template ID number ) inside the chunk's name (kind of like Bob suggested )
like so:
[[$showDetailBlogpost-[[*template]]]]
[[$showCampaignItem-[[*template]]]]
And you would create these chunks for a particular template (ID)
showDetailBlogpost-3
showCampaignItem-5
I don't know whether calls to a non-existent chunk throw errors in revo.