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.

EE2 Atom Template

July 08, 2010 3:56am

Subscribe [2]
  • #1 / Jul 08, 2010 3:56am

    bensmithett

    3 posts

    Hi,

    The current feed templates don’t work for EE2.

    This bug has been fixed for the next release, but in the meantime is anyone able to provide an Atom template that will work with EE2? (Similar to the RSS2.0 template provided here)

    Thanks 😊

  • #2 / Jul 08, 2010 3:51pm

    Ingmar

    29245 posts

    There really shouldn’t be any fundamental differences. Try this:

    {preload_replace:master_channel_name="default_site"}
    {preload_replace:atom_feed_location="site/atom"}
    
    {exp:rss:feed channel="{master_channel_name}"}
    
    <?xml version="1.0" encoding="{encoding}"?>
    <feed >
    
        <title type="text">{exp:xml_encode}{channel_name}{/exp:xml_encode}</title>
        <subtitle type="text">{exp:xml_encode}{channel_name}:{channel_description}{/exp:xml_encode}</subtitle>
        <link rel="alternate" type="text/html" href="{channel_url}" />
        <link rel="self" type="application/atom+xml" href="{path={atom_feed_location}}" />
        <updated>{gmt_edit_date format='%Y-%m-%dT%H:%i:%sZ'}</updated>
        <rights>Copyright (c) {gmt_date format="%Y"}, {author}</rights>
        <generator uri="http://expressionengine.com/" version="{version}">ExpressionEngine</generator>
        <id>tag:{trimmed_url},{gmt_date format="%Y:%m:%d"}</id>
    
    {exp:channel:entries channel="{master_channel_name}" limit="15" rdf="off" dynamic_start="on" disable="member_data|trackbacks"}
        <entry>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link rel="alternate" type="text/html" href="{url_title_path=site/index}" />
          <id>tag:{trimmed_url},{gmt_entry_date format="%Y"}:{relative_url}/{channel_id}.{entry_id}</id>
          {gmt_entry_date format="%Y-%m-%dT%H:%i:%sZ"}</published>
          <updated>{gmt_edit_date format='%Y-%m-%dT%H:%i:%sZ'}</updated>
          <author>
                <name>{author}</name>
                <email>{email}</email>
                {if url}<uri>{url}</uri>{/if}
          </author>
    {categories}
          <category term="{exp:xml_encode}{category_name}{/exp:xml_encode}"
            scheme="{path=site/index}"
            label="{exp:xml_encode}{category_name}{/exp:xml_encode}" >{/categories}
          <content type="html"><![CDATA[
            {body} {extended}
          ]]></content>
        </entry>
    {/exp:channel:entries}
    
    </feed>
    {/exp:rss:feed}

    Basically I just replaced “weblog” with “channel” everywhere.

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

ExpressionEngine News!

#eecms, #events, #releases