Skip to content

Instantly share code, notes, and snippets.

@georgringer
Last active April 13, 2017 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save georgringer/5a86262054a5d9bacee0197e1344d8e1 to your computer and use it in GitHub Desktop.
Save georgringer/5a86262054a5d9bacee0197e1344d8e1 to your computer and use it in GitHub Desktop.
Render news with same tags, using VHS+news
{f:render(section:'tagIds',arguments:_all) -> f:spaceless() -> v:variable.set(name: 'tagIds')}
<f:if condition="{tagIds} != ''">
<h4>
<f:translate extensionName="theme" key="news.related-news"/>
</h4>
<f:cObject typoscriptObjectPath="lib.tx_news.relatedByTags" data="{pid:newsItem.pid,tags:tagIds,actualNewsUid:newsItem.uid}"/>
</f:if>
<f:section name="tagIds">
<f:for each="{newsItem.tags}" as="tag">{tag.uid},</f:for>
</f:section>
lib.tx_news.relatedByTags = USER
lib.tx_news.relatedByTags {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = News
pluginName = Pi1
vendorName = GeorgRinger
switchableControllerActions {
News {
1 = list
}
}
settings < plugin.tx_news.settings
settings {
templateLayout = tagRelated
useStdWrap := addToList(startingpoint,tags,hideIdList)
startingpoint.field = pid
tags.field = tags
hideIdList.field = actualNewsUid
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment