From 9744867033e9873de73cdac5feba555ad83d67c8 Mon Sep 17 00:00:00 2001 From: Masoud Hedayati Date: Fri, 10 Jul 2020 00:16:06 +0200 Subject: [PATCH] anchor wrapped around spotlight items --- ...eTypes.Content.Section.Spotlight.Item.yaml | 20 +++++++++++++++++++ .../Content/Section/Spotlight.Item.fusion | 14 +++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Configuration/NodeTypes.Content.Section.Spotlight.Item.yaml b/Configuration/NodeTypes.Content.Section.Spotlight.Item.yaml index 2ce9d752..8b5f07e0 100644 --- a/Configuration/NodeTypes.Content.Section.Spotlight.Item.yaml +++ b/Configuration/NodeTypes.Content.Section.Spotlight.Item.yaml @@ -13,6 +13,9 @@ text: label: "Text" icon: icon-bars + anchor: + label: 'Anchor' + icon: icon-link properties: spotLogo: @@ -42,3 +45,20 @@ label: 'left' 'align-right': label: 'right' + + link: + type: string + ui: + label: 'Linked to:' + inspector: + group: anchor + editor: 'Neos.Neos/Inspector/Editors/LinkEditor' + + target: + type: boolean + ui: + label: 'Open In New window' + inspector: + group: anchor + + diff --git a/Resources/Private/Fusion/Content/Section/Spotlight.Item.fusion b/Resources/Private/Fusion/Content/Section/Spotlight.Item.fusion index 5cf71ba6..f5c65915 100644 --- a/Resources/Private/Fusion/Content/Section/Spotlight.Item.fusion +++ b/Resources/Private/Fusion/Content/Section/Spotlight.Item.fusion @@ -44,6 +44,12 @@ prototype(Sitegeist.NeosTemplate.Spectral:Content.Section.Spotlight.Item) < prot } } + href = ${q(node).property('link')} + href.@if.inBackend = ${node.context.live} + href.@process.convertUris = Neos.Neos:ConvertUris + + target = ${q(node).property('target')} + alignment = ${q(node).property('alignment')} @@ -60,4 +66,12 @@ prototype(Sitegeist.NeosTemplate.Spectral:Content.Section.Spotlight.Item) < prot ` + renderer.@process.wrapInAnchor = Neos.Fusion:Tag { + tagName = 'a' + attributes.href = ${props.href} + attributes.target = '_blank' + attributes.target.@if.ifChecked = ${props.targetgi} + content = ${value} + @if.hasAnchor = ${props.href} + } }