[MGNLSTK-1185] TemplateAvailability is restricted to existing nodes Created: 11/Jun/13  Updated: 25/Jun/13  Resolved: 25/Jun/13

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

Type: Improvement Priority: Neutral
Reporter: Espen Jervidalo Assignee: Espen Jervidalo
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLUI-1580 pages-app: create new page ignores pa... Closed
is related to MGNLSTK-1052 Template availability expects to be p... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

The available templates are determined by the parents template category, so it should be easy to check for available child templates for a yet not created page.
The only thing that is preventing this is in #isAvailable:

if(node.getDepth() == 1)

{ return category.equals(TemplateCategory.HOME) || category.equals(TemplateCategory.FUNCTIONAL); }

Extending the interfaces would end up in a huge code duplication down to that method.



 Comments   
Comment by Tobias Mattsson [ 25/Jun/13 ]

This is by design how template availability works. An existing node is passed to info.magnolia.rendering.template.TemplateAvailability so an implementation, such as the one in STK must follow this contract.

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