[TYPO3-mvc] problem with fluid template for a rss feed

Kerstin Eitner eitner.kerstin at googlemail.com
Fri Nov 11 13:07:29 CET 2011


Hi Bastian,

i want to have the following output in my rss feed:

<content:encoded>
	<![CDATA[<b>Today is friday!</b><a href="http://www.typo3.org">TYPO3 is 
fun.</a>]]>
</content:encoded>


1. f:format.stripTags()
If i do it like you suggested and shown in the FLOW3 Blog Example

<description>{post.content -> f:format.stripTags() -> 
f:format.htmlspecialchars()}</description>

then all my markups (<b><a> and so on) are stripped out.
But for my rss feed i want to have all the markups inside, so that it 
looks fine in the rss reader with paragraphs, images and links.


2. CDATA
I thought that I have to use CDATA, in order that the markup (<b> <p>)is 
not interpreted as rss tags.
But if i use CDATA then the rest is ignored by fluid. That means that 
fluid does not render the bodytext of my newsItem. Furthermore the CDATA 
does not show up in the output.

This example:
<content:encoded>
	<![CDATA[{newsItem.bodytext}]]>
</content:encoded>

delivers the following output in the rss feed:
<content:encoded>
	{newsItem.bodytext}
</content:encoded>


This is where i am stuck at the moment...

Anybody some other ideas to point me in the right direction?

Thanks in advance and greets
Kerstin





Am 11.11.2011 10:59, schrieb Bastian Waidelich:
> Kerstin Eitner wrote:
>
> Hi Kerstin,
>
>> In order the rss feed has the right structure and the hmtl-code is not
>> interpreted as rss-tags, i have to wrap this into CDATA tags like:
>>
>> <content:encoded>
>> <![CDATA[<b>test</b>]]>
>> </content:encoded>
>
> Everything in CDATA tags is ignored by Fluid. As you can see from my
> previous example, you shouldn't need CDATA tags at all.
> have a look at the FLOW3 Blog package [1]
>
> HTH
> Bastiasn
>
>
> [1]
> http://git.typo3.org/FLOW3/Packages/TYPO3.Blog.git?a=blob;f=Resources/Private/Templates/Post/Index.atom.xml;h=e59c27a510e339b29f110f98b084604be79ea2b2;hb=HEAD
>



More information about the TYPO3-project-typo3v4mvc mailing list