Skip to content

Instantly share code, notes, and snippets.

@Avalarion
Created June 21, 2013 20:50
Show Gist options
  • Save Avalarion/5834231 to your computer and use it in GitHub Desktop.
Save Avalarion/5834231 to your computer and use it in GitHub Desktop.
Changes for TYPO3 Extension News ( tx_news ): Enable Preview Image in rss-feed Edited File: Templates/News/List.xml
<?xml version="1.0" encoding="utf-8"?>
{namespace n=Tx_News_ViewHelpers}
<rss version="2.0">
<channel>
<title>{settings.list.rss.channel.title}</title>
<link>{settings.list.rss.channel.link}</link>
<description>{settings.list.rss.channel.description}</description>
<language>de</language>
<f:if condition="{settings.list.rss.channel.copyright}">
<copyright>{settings.list.rss.channel.copyright}</copyright>
</f:if>
<pubDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></pubDate>
<lastBuildDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1" /></lastBuildDate>
<f:if condition="{settings.list.rss.channel.category}">
<category>{settings.list.rss.channel.category}</category>
</f:if>
<generator>{settings.list.rss.channel.generator}</generator>
<f:if condition="{news}">
<f:for each="{news}" as="newsItem">
<item>
<guid isPermaLink="false">news-{newsItem.uid}</guid>
<pubDate><n:format.date format="%a, %d %b %Y %T %z" currentDate="1" strftime="1">{newsItem.datetime}</n:format.date></pubDate>
<title><n:format.hsc>{newsItem.title}</n:format.hsc></title>
<link><n:format.hsc><n:link newsItem="{newsItem}" settings="{settings}" uriOnly="1" /></n:format.hsc></link>
<description>
<f:format.cdata>
<f:if condition="{newsItem.media}">
<f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
<f:if condition="{mediaElement.type} == 0">
<f:format.raw>
<f:image
src="uploads/tx_news/{mediaElement.image}"
title="{mediaElement.title}"
alt="{mediaElement.alt}"
/>
</f:format.raw>
</f:if>
</f:alias>
</f:if>
<n:format.hsc><n:format.striptags>{newsItem.teaser}</n:format.striptags></n:format.hsc>
</f:format.cdata>
</description>
</item>
</f:for>
</f:if>
</channel>
</rss>
@ses2013
Copy link

ses2013 commented Dec 1, 2015

Produces rss Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment