Use the addTemplateObject() method in the default template factory.