Uploaded image for project: 'Magnolia Standard Templating Kit (closed)'
  1. Magnolia Standard Templating Kit (closed)
  2. MGNLSTK-763

Subtemplates are not merged with the prototype

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • None
    • 1.4.1
    • templates

    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; }

      };
      }

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              pbaerfuss Philipp Bärfuss
              sbaur Stefan Baur
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: