Last active
October 9, 2019 07:59
-
-
Save Sebobo/0f08bfdb9576aaacaa0ecede6701494a to your computer and use it in GitHub Desktop.
Structured data tags in Neos CMS
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
| prototype(Neos.Fusion:DataStructureComponent) < prototype(Neos.Fusion:Component) { | |
| prototype(Neos.Fusion:Tag) { | |
| @class = 'Neos\\Fusion\\FusionObjects\\DataStructureImplementation' | |
| @ignoreProperties = ${['tagName', 'content', 'attributes', 'selfClosingTag', 'omitClosingTag']} | |
| '@type' = ${this.tagName} | |
| } | |
| @process { | |
| setContext = ${Array.set(value, '@context', 'http://schema.org')} | |
| toJson = ${Json.stringify(value)} | |
| wrap = ${'<script type="application/ld+json">' + value + '</script>'} | |
| } | |
| } | |
| prototype(Neos.Seo:StructuredData.Breadcrumb) < prototype(Neos.Fusion:DataStructureComponent) { | |
| items = ${q(documentNode).add(q(documentNode).parents('[instanceof Neos.Neos:Document]')).get()} | |
| items.@process.reverse = ${Array.reverse(value)} | |
| renderer = afx` | |
| <BreadcrumbList> | |
| <Neos.Fusion:Map items={props.items} iterationName="iteration" @path="itemListElement"> | |
| <ListItem position={iteration.cycle} name={item.label}> | |
| <Neos.Neos:NodeUri node={item} absolute={true} @path="item"/> | |
| </ListItem> | |
| </Neos.Fusion:Map> | |
| </BreadcrumbList> | |
| ` | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment