Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
1.2
-
None
-
None
-
-
Empty show more show less
-
Sprint 2 (Basel)
-
5
Description
Given a page structure like this:
- home (template-type ‘home’)
- variants
- variant-0
- variant-1
- bla-feature (template-type ‘feature’)
- variants
using any templating functions like cmsfn.page(content) or cmsfn.siteRoot(content) on one of the variants will return the variant and not the actual ‘home’-page.
So when you e.g. want to find a page with template-type ‘feature’ it won’t start searching from the actual site-root ‘home’ but from the variant and therefor fail.
info.magnolia.templating.functions.TemplatingFunctions#contentListByTemplateType(..., siteRoot, ..) info.magnolia.rendering.template.type.TemplateTypeHelper#getContentListByTemplateIds
The path returned here is /home/variants/variant-0 because of info.magnolia.personalization.decoration.PersonalizationNodeWrapper#getPath returning the path of the wrapped node and not the original.
#getPath returns the path to variant on purpose because it’s the only way to differentiate whether we’re dealing with a variant and changing it would probably need significant changes to the page editor. OTOH it seems a bit misleading as other overridden methods do take the original node into account.
We worked around this problem in MGNLDEMO-79 but for fixing e.g. MGNLDEMO-78 we would again have to work around this issue.
Proposed fix:
One proposal which works and is committed to branch is to have p13n replace and override the TemplatingFunctions by a variant-aware one, which overrides the affected functions, in this case #page(content) will make sure we get the page and not the variant.
Problem: It’s an easy fix, but there might be customers already replacing the TemplatingFunctions. Besides that what do you expect when you call #page(content)? The page or the variant of the page?
Checklists
Attachments
Issue Links
- is causing
-
MGNLDEMO-79 Navigation broken on page variants
-
- Closed
-
-
MGNLPN-226 STK's navigation doesn't show variant's title anymore due to TemplatingFunctions resolving the master node (siteRoot)
-
- Closed
-
-
MAGNOLIA-6297 re-fix site root resolution after splitting templating
-
- Closed
-
- is depended upon by
-
MGNLDEMO-78 Hardcoded link about page breaks rendering
-
- Closed
-