I'm not sure if I understand your question. Can you please elaborate? Especially, what do you mean with "template"? In DokuWiki terms a template is a skin/theme. I guess you mean something else?
The
data plugin,
data template plugin and the core
namespace templates might be relevant.