Skip to content

Commit

Permalink
anchor wrapped around spotlight items
Browse files Browse the repository at this point in the history
  • Loading branch information
hedayati-m committed Jul 9, 2020
1 parent c251edd commit 9744867
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Configuration/NodeTypes.Content.Section.Spotlight.Item.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
text:
label: "Text"
icon: icon-bars
anchor:
label: 'Anchor'
icon: icon-link

properties:
spotLogo:
Expand Down Expand Up @@ -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


14 changes: 14 additions & 0 deletions Resources/Private/Fusion/Content/Section/Spotlight.Item.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -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')}


Expand All @@ -60,4 +66,12 @@ prototype(Sitegeist.NeosTemplate.Spectral:Content.Section.Spotlight.Item) < prot
</div>
</section>
`
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}
}
}

0 comments on commit 9744867

Please sign in to comment.