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.

date variable not working in RSS temaplte (gmt_date does work)

April 19, 2012 9:34am

Subscribe [2]
  • #1 / Apr 19, 2012 9:34am

    Zac G.

    268 posts

    Hi,

    I have an RSS feed that works fine when the date is set it:

    <dc:date>{gmt_date format="{DATE_ATOM}"}</dc:date>

    But it breaks when I try to do this (using any formatting):

    <dc:date>{date format="{DATE_ATOM}"}</dc:date>

    Date is listed as a parameter here: http://ellislab.com/expressionengine/user-guide/modules/rss/index.html#variables, I’m not sure what I’m missing.

    Thanks!

  • #2 / Apr 20, 2012 10:55am

    Dan Decker

    7338 posts

    Hi Zac,

    I’m sorry this is misbehaving for you!

    Have you tried other date variables as well? Like:

    {current_time format="{DATE_ATOM}"}

    What version of ExpressionEngine are you using? Can you share the complete template here too?

    Cheers,

     

  • #3 / Apr 20, 2012 11:10am

    Zac G.

    268 posts

    Hey!

    I’m on 2.4.0 and other time formats work, just not “day”

    Thanks

  • #4 / Apr 23, 2012 3:09pm

    Shane Eckert

    7174 posts

    Hey Zac,

    That is odd.

    Can I see your entire template?

    We will go from there.

    Cheers,

  • #5 / Apr 23, 2012 4:23pm

    Zac G.

    268 posts

    Sure thing!

    Here you go:

    {exp:rss:feed channel="posts" debug="no" status="open"}
    <?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/"
        xmlns:atom="http://www.w3.org/2005/Atom">
    
        <channel>
        <atom:link href="http://www.devotime.dcmetro.org/feeds/main" rel="self" type="application/rss+xml" >
        
        <title>My Title</title>
        <link>http://domain.org</link>
        <description>Description here</description>
        <dc:language>{channel_language}</dc:language>
        <dc:creator>{email}</dc:creator>
        <dc:rights>Copyright {date format="%Y"}</dc:rights>
        <dc:date>{date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
        <admin:generatorAgent rdf:resource="http://expressionengine.com/" >
        
    {exp:channel:entries channel="channel_name" limit="1" sort="desc" orderby="date" dynamic_start="on" disable="member_data"}
        <item>
          <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
          <link>{site_url}/{entry_date format='%Y'}/{entry_date format='%m'}/{entry_date format='%d'}/{url_title}/</link>
          <guid>{site_url}/{entry_date format='%Y'}/{entry_date format='%m'}/{entry_date format='%d'}/{url_title}/#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
          <description><![CDATA[{post_content} {post_video}]]></description> 
          <dc:date>{date format="{DATE_ATOM}"}</dc:date>
        </item>
    {/exp:channel:entries}
        </channel>
    </rss>
    {/exp:rss:feed}
  • #6 / Apr 25, 2012 3:44pm

    Dan Decker

    7338 posts

    Hi Zac,

    I was not able to replicate the issue on my installation using your template.

    Everything rendered fine. Can you give us some screenshots or output examples of how this is breaking for you?

    Cheers,

  • #7 / Apr 25, 2012 5:51pm

    Zac G.

    268 posts

    Ok, possibly feel like a fool here, but {date wasn’t working inside the channel entries tag.  Switched to entry_date and it works (as does gmt_time).

    Thanks Dan

  • #8 / Apr 26, 2012 3:43pm

    Shane Eckert

    7174 posts

    Hi Zac,

    Glad to hear it!

    Dan rocks.

    If you need anything else, please just let us know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases