[MGNLSITE-26] Prevent "freemarker" page templates to be added to an explicitly mapped site Created: 10/Aug/15  Updated: 03/Oct/17

Status: Open
Project: Magnolia Site Module
Component/s: api
Affects Version/s: 1.0
Fix Version/s: None

Type: Task Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: to-specify
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File SiteAwareTemplateAvailability.patch    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

The current implementation of SiteAwareTemplateAvailability & ConfiguredSiteTemplateAvailability does not allow you to achieve following:

  • Filter out pages of renderType "freemarker"

This means:
If you add a freemarker page into any module, it will be available in any site of the whole system.
No way you can filter them out via site.getTemplates().getAvailability().

The correct behavior for freemarker templates should be (and as it was before 5.4):

  • Freemarker templates can be added to any top level page (don't have a site definition yet).
  • Can't be added to any site with an explicit site definition (not "default")
  • Can be added into any site using the "default" site definition (no explicit mapping int he site definition)

I added a patch that achieves this. Basically it checks if the current node is a part of a mapped site definition.


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