Created
March 18, 2019 17:02
-
-
Save mficzel/69de7968880d9073e0924f07d51e66d8 to your computer and use it in GitHub Desktop.
Seperation of Presentation and Integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Presentational - prototype that encapsulates rendering of a page header | |
# without caring where title and description originate from | |
# | |
# Notice: | |
# - the base prototype is Neos.Fusion:Component | |
# | |
prototype(Vendor.Site:Component.Organism.Head) < prototype(Neos.Fusion:Component) { | |
title = '' | |
intro = '' | |
renderer = afx` | |
<div class=="header"> | |
<h1>{props.title}</h1> | |
<p class="intro" @if.has={props.intro}>{props.intro}</p> | |
</div> | |
` | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Integrational - prototype that renders a content nodetype using a presentational component | |
# | |
# Notice: | |
# - the name of the prototype has to match the nodetype | |
# - the base prototype is Neos.Neos:ContentComponent | |
# | |
prototype(Vendor.Site:Content.Header) < prototype(Neos.Neos:ContentComponent) { | |
renderer = Vendor.Site:Component.Organism.Head { | |
title = ${q(node).property('title')} | |
intro = ${q(node).property('metaDescriotion')} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment