Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2891

Sub Templates configuration needs to be reviewed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Outdated
    • Major
    • None
    • 4.1.1
    • templating
    • None
    • Mac OS X 10.5.8, FF 3, Tomcat 5.5.27

    Description

      The sub template configuration works only under very specific conditions. The way it is described in http://documentation.magnolia-cms.com/templating-guide.html it will not work and if it does, it's more of a coincident then a logical configuration.

      To make the sub template configuration work, you have to follow these rules:
      a) The sub template child node identifier has to have exactly the same name as the value in the "extension" property.
      /subTemplates
      /testing
      extension --> testing
      templatePath --> /templates/myproject/templates/sub/somescript.jsp
      a different node name than extension will not work. In fact, Magnolia does not even recognize there is a sub template.

      b) You are obliged to add the "type" property. Without the "type" property the rendering will not work, even if you have the same sub template node identifier as the "extension" value. If "type" is not set, you will get a status 500 error:
      java.lang.RuntimeException: java.lang.RuntimeException: No renderer found for type null
      info.magnolia.module.templating.RenderingFilter.doFilter(RenderingFilter.java:119)
      info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:70)
      info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      info.magnolia.cms.filters.BackwardCompatibilityFilter.doFilter(BackwardCompatibilityFilter.java:72)
      info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:62)
      info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      info.magnolia.cms.filters.InterceptFilter.doFilter(InterceptFilter.java:121)
      info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:70)
      info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      info.magnolia.cms.filters.AggregatorFilter.doFilter(AggregatorFilter.java:103)

      So the "correct" sub template is:
      /subTemplates
      /testing
      extension --> testing
      templatePath --> /templates/myproject/templates/sub/somescript.jsp
      type --> jsp

      I don't think this is a wanted functionality, since it is not an "intuitive" configuration.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              pbaerfuss Philipp Bärfuss
              giancarlo Giancarlo Berner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD