[MAGNOLIA-4516] TemplatingFunctions.inherit() limits inheritance to mgnl:components with "inheritable" property = true Created: 24/Aug/12  Updated: 13/Nov/14  Resolved: 29/Oct/14

Status: Closed
Project: Magnolia
Component/s: freemarker, rendering, templating
Affects Version/s: None
Fix Version/s: 5.3.5

Type: Improvement Priority: Major
Reporter: Will Scheidegger Assignee: Roman Kovařík
Resolution: Fixed Votes: 2
Labels: inherit, support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing MAGNOLIA-5985 Instantiation of inner classes Filter... Closed
relation
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)
Date of First Response:

 Description   

cmsfn.inherit() only supports the inheritance of mgnl:component nodes and only if they have a property "inheritable" set to true. Switching to the inheritAll configuration (which can only be done when modifying the TemplatingFunctions code) does not help either because "inheritAll" still limits to mgnl:component nodes.

A plain inherit() should support inheritance of all nodes and properties. For special needs (e.g. component inheritance in the extras area) this can still be specifically limited.

See http://forum.magnolia-cms.com/forum/thread.html?threadId=7f5f6891-d0d7-4ee5-a450-7337e077bb26#9dd9bc59-8796-43e1-9dbc-951646612ce1 for more info.



 Comments   
Comment by Will Scheidegger [ 14/Feb/13 ]

Any word on this issue? We keep tripping over this and would really appreciate a solution. Thanks!

Comment by Roman Kovařík [ 20/Oct/14 ]

Now you can use

    
             inherit(Node content, String relPath, String nodeTypes, String nodeInheritance, String propertyInheritance)
e.g. ${cmsfn.inherit(content, "", "mgnl:area,mgnl:page", "filtered", "all").test}
or   ${cmsfn.inherit(content, "", "nt:base", "all", "none").test}
Generated at Mon Feb 12 03:56:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.