[MAGNOLIA-2891] Sub Templates configuration needs to be reviewed Created: 12/Oct/09  Updated: 04/Dec/13  Resolved: 04/Dec/13

Status: Closed
Project: Magnolia
Component/s: templating
Affects Version/s: 4.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Giancarlo Berner Assignee: Philipp Bärfuss
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.5.8, FF 3, Tomcat 5.5.27


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 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.



 Comments   
Comment by Jan Haderka [ 04/Dec/13 ]

Subtemplates have been completely reworked in framework of 4.5/5.0 and are now supported via variations and channels. This issue is therefore obsolete.

Generated at Mon Feb 12 03:41:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.