is it possible to return content through the templating system without using a .adp file? I'm cleaning/refactoring an old app and have hit a couple of spots where it'd be great to be able to return content from an <include>ed .tcl fragment without needing an associated .adp file.
there are several spots where html is being hand-generated by TCL code. I've split these out to page fragments that can be included, but the .tcl file is the only bit that actually does anything - it builds up content in a html_output variable and then the .adp contains nothing but
@html_output@
several other spots have content that may or may not be included in an output page and is currently wrapped in templating system conditionals which I've broken out for reuse elsewhere as includable page fragments. these contain both .tcl and .adp files where the entire content of the .adp is wrapped in a templating conditional. I'd like to be able to remove this cruft from the .adp and put something like this at the top of the .tcl file to make it skip the .adp and just return an empty string if there is nothing relevant to show -
if {![asset_has_related_items $asset_id]} {
# what do I use for these calls?
adp_return_content ""
adp_abort
}
template::adp_puts appears to be what I want for returning content from the .tcl file, except it only seems to work in escaped TCL code inside a .adp page. I've not found anything that works for stopping the evaluation of an included fragment that doesn't also kill the including page as well...
is this sort of fooling with the template system supported?