ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Linebreaks disappearing in RSS feed

January 29, 2010 6:31pm

Subscribe [2]
  • #1 / Jan 29, 2010 6:31pm

    vfalconi

    4 posts

    I’ve tried everything I know to do, but I can’t seem to get my linebreaks to convert to br tags in a feed. The linebreaks are there, I can see them in a feed validator. And the field is set to “Auto BR” but they aren’t converting. Any ideas?

    (caveat: i just modified the default EE RSS template, as RSS feeds and I get along like printers and i do: not very well.)

    here’s my code…

    {assign_variable:master_weblog_name="{segment_3}"}
    {exp:rss:feed weblog="{master_weblog_name}"}
    
    <?xml version="1.0" encoding="{encoding}"?>
    <rss version="2.0"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
        xmlns:admin="http://webns.net/mvcb/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:content="http://purl.org/rss/1.0/modules/content/">
    
        <channel>
        
        <title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
        <link>{weblog_url}</link>
        <description>{weblog_description}</description>
        <dc:language>{weblog_language}</dc:language>
        <dc:creator>{email}</dc:creator>
        <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
        <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        <admin:generatorAgent rdf:resource="http://expressionengine.com/" >
        
    {exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{title_permalink=site/index}</link>
          <guid>{title_permalink=site/index}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description>{exp:xml_encode}{summary}{body}{/exp:xml_encode}</description>
          <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
          <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        </item>
    {/exp:weblog:entries}
        
        </channel>
    </rss>
    
    {/exp:rss:feed}
  • #2 / Jan 29, 2010 7:55pm

    Adam Dorsey

    1439 posts

    Not all RSS aggregators read XHTML elements like tags and <br>

    I would try changing the description line, and adding some CDATA magic:

    <description><![CDATA[{exp:xml_encode}{summary}{body}{/exp:xml_encode}]]></description>

    Does that work for you?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases