[Templates] ttree questions

Andy Wardley abw@andywardley.com
Mon, 6 Oct 2003 13:13:50 +0100


Mark Anderson wrote:
> Is there any way in a template to get at the name of the file that
> template that ttree was invoked on (note this is different
> from the current template, in the case of INCLUDE/PROCESS)?

The 'template' variable references the page template that ttree was
invoked on.

The 'component' variable references the current template, which, 
as you note, may be different from 'template'.

Both 'template' and 'component' are objects (Template::Document).
You can call 'template.name' or 'component.name' to get the file
path (relative to INCLUDE_PATH, i.e. what ttree is invoked on).

> Is there any way to get ttree to generate files with a different
> suffix than the template?

No, not that I know of.  Would be nice, though.

A