Skip to content

Commit

Permalink
TASK: Add RichSnippets
Browse files Browse the repository at this point in the history
  • Loading branch information
johannessteu committed Feb 19, 2016
1 parent 76aaab2 commit 8f8c15f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
33 changes: 26 additions & 7 deletions Resources/Private/Templates/TypoScriptObjects/News.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
{namespace neos=TYPO3\Neos\ViewHelpers}

<f:section name="news">
<div class="news-item {f:if(condition:'{isImportant}', then:'news-item--important')}" itemscope itemtype="http://schema.org/NewsArticle">
<meta itemscope itemprop="mainEntityOfPage" itemType="https://schema.org/WebPage" itemid="https://google.com/article"/>
<div class="news-item {f:if(condition:'{isImportant}', then:'news-item--important')}">
<script type="application/ld+json">
<![CDATA[
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage":{
"@type":"WebPage",
"@id":"https://google.com/article"
},
"headline": "]]>{title}<![CDATA[",
"datePublished": "]]>{f:format.date(date:'{publishDate}', format:'Y-m-d H:i')}<![CDATA[",
"dateModified": "]]>{f:format.date(date:'{lastModificationDate}', format:'Y-m-d H:i')}<![CDATA[",
"description": "]]>{teaser}<![CDATA["
}
]]>
</script>

<h1 class="news-item__title" itemprop="headline">
<neos:contentElement.editable property="title" />
<h1 class="news-item__title">
<neos:contentElement.editable property="title"/>
</h1>

<p class="news-tem__teaser-text" itemprop="description"><neos:contentElement.editable property="teaser" /></p>
<p class="news-tem__teaser-text">
<neos:contentElement.editable property="teaser"/>
</p>

<div class="news-item__content">
{content -> f:format.raw()}
Expand All @@ -19,8 +36,10 @@ <h1 class="news-item__title" itemprop="headline">
<f:section name="newsTeaser">
<div class="news-item-teaser">
<h3 class="news-item-teaser__title">
<neos:contentElement.editable property="title" />
<neos:contentElement.editable property="title"/>
</h3>
<p class="news-item-teaser__teaser-text"><neos:contentElement.editable property="teaser" /></p>
<p class="news-item-teaser__teaser-text">
<neos:contentElement.editable property="teaser"/>
</p>
</div>
</f:section>
1 change: 1 addition & 0 deletions Resources/Private/TypoScript/NodeTypes/News.ts2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ prototype(JohannesSteu.Neos.News:NewsDetail) < prototype(TYPO3.Neos:Content) {
// General properties
publishDate = ${q(node).property('publishDate')}
archiveDate = ${q(node).property('archiveDate')}
lastModificationDate = ${q(node).property('_lastModificationDateTime')}

title = ${q(node).property('title')}
teaser = ${q(node).property('teaser')}
Expand Down

0 comments on commit 8f8c15f

Please sign in to comment.