[MGNLSTK-763] Subtemplates are not merged with the prototype Created: 12/Apr/11  Updated: 13/Jun/13  Resolved: 13/Jun/13

Status: Closed
Project: Magnolia Standard Templating Kit (closed)
Component/s: templates
Affects Version/s: 1.4.1
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Stefan Baur Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: subtemplates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty

 Description   

A subtemplate definition (in my case print) defined in the template prototype in the site definition is not taken into account in rendering. If I instead move the subtemplates node to my template definition, it instantly works. This means, that I have to copy the subtemplate definition to each template. Otherwise, I could define it centrally.

Am I missing something, or is there another reason why this doesent work?

here is my NodeOperation that creates the subtemplate definition:

public static NodeOperation addSubTemplateNode(final String subTemplateName, final String subTemplateFileName) {
return new AbstractNodeOperation() {
protected Content doExec(Content context, ErrorHandler errorHandler) throws RepositoryException

{ Content subTemplatesNode = ContentUtil.getOrCreateContent(context, "subTemplates", context.getItemType()); Content subTemplateNode = ContentUtil.getOrCreateContent(subTemplatesNode, subTemplateName, context.getItemType()); subTemplateNode.setNodeData("class", "info.magnolia.module.templatingkit.templates.STKTemplate"); subTemplateNode.setNodeData("extension", subTemplateName); subTemplateNode.setNodeData("modelClass", "info.magnolia.module.templatingkit.templates.STKTemplateModel"); subTemplateNode.setNodeData("templatePath", subTemplateFileName); subTemplateNode.setNodeData("type", BALOISE_TEMPLATE_RENDERER_NAME); subTemplateNode.setNodeData("i18nBasename", BALOISE_INTERNET_I18N_BASENAME); return subTemplateNode; }

};
}



 Comments   
Comment by Stefan Baur [ 18/Jan/13 ]

Going through my reported tickets...

Not relevant anymore with STK 2.x in place. Can be closed (why can't I close my own ticket? )

Generated at Mon Feb 12 07:30:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.