[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: |
|
||||||||||||
| 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. 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. |