From e269b41acfc9577308b0262f185bc4eb9f05ad82 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 25 Jan 2021 17:16:39 +0100 Subject: [PATCH 1/3] BUGFIX: Use fallback node for canonical link Without this change untranslated pages have canonicals to themselves instead of their fallback node if set. --- .../Private/Fusion/Metadata/CanonicalLink.fusion | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Resources/Private/Fusion/Metadata/CanonicalLink.fusion b/Resources/Private/Fusion/Metadata/CanonicalLink.fusion index 2bdca1c8..3e736f77 100644 --- a/Resources/Private/Fusion/Metadata/CanonicalLink.fusion +++ b/Resources/Private/Fusion/Metadata/CanonicalLink.fusion @@ -3,7 +3,17 @@ prototype(Neos.Seo:CanonicalLink) < prototype(Neos.Fusion:Tag) { attributes { rel = 'canonical' href = Neos.Fusion:Component { - node = ${documentNode} + node = Neos.Fusion:Case { + useFallback { + condition = ${node.dimensions != node.context.targetDimensionValues} + targetDimensions = ${Array.map(node.dimensions, (item) => item[0])} + renderer = ${q(node).context({dimensions: node.dimensions, targetDimensions: this.targetDimensions}).get(0)} + } + default { + condition = true + renderer = ${node} + } + } canonicalLink = ${q(this.node).property('canonicalLink')} renderer = Neos.Fusion:Case { From 9f88a1c8d917ec3d5bcf0fa54290956e149239fc Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 25 Jan 2021 17:19:08 +0100 Subject: [PATCH 2/3] BUGFIX: Skip alternate language links to non translated pages --- Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion b/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion index baeb42ec..4f3965af 100644 --- a/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion +++ b/Resources/Private/Fusion/Metadata/AlternateLanguageLinks.fusion @@ -22,6 +22,7 @@ prototype(Neos.Seo:AlternateLanguageLinks) < prototype(Neos.Fusion:Component) { @if.isDefaultLocale={props.defaultLocale == item.dimensions[props.dimension][0]}/> ` From 2d8fd9bb1a1fc94eb40d0335766117cead2a2f50 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Mon, 25 Jan 2021 17:30:36 +0100 Subject: [PATCH 3/3] BUGFIX: Render fallback aware html lang attribute --- Resources/Private/Fusion/Metadata/LangAttribute.fusion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Private/Fusion/Metadata/LangAttribute.fusion b/Resources/Private/Fusion/Metadata/LangAttribute.fusion index 4560c3e1..fc367831 100644 --- a/Resources/Private/Fusion/Metadata/LangAttribute.fusion +++ b/Resources/Private/Fusion/Metadata/LangAttribute.fusion @@ -1,5 +1,5 @@ prototype(Neos.Seo:LangAttribute) < prototype(Neos.Fusion:Value) { - value = ${String.replace(documentNode.context.dimensions.language[0], '_', '-')} + value = ${String.replace(documentNode.dimensions.language[0], '_', '-')} @if.languageDimensionExists = ${Configuration.setting('Neos.ContentRepository.contentDimensions.language') != null} @if.onlyRenderWhenInLiveWorkspace = ${node.context.workspace.name == 'live'} }