Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthormacmathan
    • CommentTimeApr 18th 2010
     permalink
    I have had a long term ongoing issue with my atom feed never validating, but the reason why was discovered this weekend.

    The filter hook "the_content_rss" was non-existent in the template and thus never triggered, so no change of entities to numerical values took place. (Yes I know, my bad DB but it made me find this issue...)

    Besides fixing the hook issue I took the liberty to include the entry author for the entry in the atom template (useful for us running unofficial multiuser setups in one way or another), and the code is validating well with feedvalidator.org and w3.org:


    --- atom.tpl 2010-04-18 16:33:30.000000000 +0200
    +++ new_atom.tpl 2010-04-18 16:17:48.000000000 +0200
    @@ -18,16 +18,18 @@
    {entry_block}
    {entry}
    <entry>
    + <author>
    + <name>{$author}</name>
    + </author>
    <title>{$subject}</title>
    <link href="{$id|link:post_link}" />
    -
    <id>{$id|link:post_link}</id>
    {assign var=the_date value=$date|date_rfc3339}
    <published>{$the_date}</published>
    <updated>{$the_date}</updated>
    <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">
    - {$content|tag:the_content}
    + {$content|tag:the_content|tag:the_content_rss}
    </div>
    </content>


    The same missing hook issue is in the rss template as well, but I have added a few things more in this patch namely corrected date format on copyright and dublin core style support for the publisher/managingEditor info as well creator/author. This way it will work without exposing email adresses, and it will validate too.

    --- rss.tpl 2010-04-18 16:33:47.000000000 +0200
    +++ newnew_rss.tpl 2010-04-18 16:55:29.000000000 +0200
    @@ -1,11 +1,11 @@
    <?xml version="1.0" encoding="{$fp_config.locale.charset}" ?>
    -<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
    <title>{$flatpress.title}</title>
    <link>{$flatpress.www}</link>
    <description><![CDATA[{$flatpress.subtitle}]]></description>
    - <copyright>Copyright {$smarty.now|date_format:"$Y"}, {$flatpress.author}</copyright>
    - {*<managingEditor>{$flatpress.email} ({$flatpress.author})</managingEditor>*}
    + <copyright>Copyright {$smarty.now|date_format:"%Y"}, {$flatpress.author}</copyright>
    + <dc:publisher>{$flatpress.author}</dc:publisher>
    <language>{$fp_config.locale.lang}</language>
    <atom:link rel="self" href="{'rss2'|theme_feed_link}" type="application/rss+xml" />
    <generator>FlatPress</generator>
    @@ -15,11 +15,11 @@

    <title>{$subject}</title>
    <link>{$id|link:post_link}</link>
    - <description><![CDATA[{$content|tag:the_content}]]></description>
    + <description><![CDATA[{$content|tag:the_content|tag:the_content_rss}]]></description>
    {if ($categories)} <category><![CDATA[ {$categories|@filed:false} ]]></category>{/if}
    <guid isPermaLink="true">{$id|link:post_link}</guid>

    - {*<author>{$flatpress.email} ({$flatpress.author})</author>*}
    + <dc:creator>{$author}</dc:creator>
    <pubDate>{'r'|date:$date}</pubDate>
    <comments>{$id|link:comments_link}</comments>



    And finally... comment-rss.tpl, same story (haven't bother to try validation with it though):


    --- comment-rss.tpl 2010-04-18 17:02:15.000000000 +0200
    +++ new_comment-rss.tpl 2010-04-18 17:06:21.000000000 +0200
    @@ -5,11 +5,11 @@
    {entry}

    {assign var=the_comment_link value=$id|link:comments_link}
    - <title>{$flatpress.title} ยป {$subject}</title>
    + <title>{$flatpress.title} &#187; {$subject}</title>
    <link>{$the_comment_link}</link>
    <description><![CDATA[{$flatpress.subtitle}]]></description>
    - <copyright>Copyright {$smarty.now|date_format:"$Y"}, {$flatpress.author}</copyright>
    - {*<managingEditor>{$flatpress.email} ({$flatpress.author})</managingEditor>*}
    + <copyright>Copyright {$smarty.now|date_format:"%Y"}, {$flatpress.author}</copyright>
    + <dc:publisher>{$flatpress.author}</dc:publisher>
    <language>{$fp_config.locale.lang}</language>
    <atom:link rel="self" href="{'rss2'|theme_comments_feed_link:$id}" type="application/rss+xml" />

    @@ -21,7 +21,7 @@

    <title>{$name}</title>
    <link>{$the_comment_link}#{$id}</link>
    - <description><![CDATA[{$content|tag:the_content}]]></description>
    + <description><![CDATA[{$content|tag:the_content|tag:the_content_rss}]]></description>

    <guid isPermaLink="true">{$the_comment_link}#{$id}</guid>



    All diffs against CVS today.