We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34123
    • 103 Posts
    Hi everybody,

    I am trying to build my own RSS 1.0 with modx. To validate my feed i use feedvalidator (a package from ubuntu repo). When i scan my feed I have some bad result (that i can correct), but my main issue is related to the date format : W3CDTF.

    To correct my date format, I use the OutputFilters :

           <dc:date>[[+publishedon]]</dc:date>
    


    I have my date normally formated :

           <dc:date>2010-10-03 00:53:05</dc:date>
    


    If i use the following outputfilters :
           <dc:date>[[+publishedon:date=`%Y-%m-%dT%H:%M:%S-01:00`]]</dc:date>
    


    Here is the result :
           <dc:date>1970-01-01T01:33:30-01:00</dc:date>
    


    Am i doing something wrong ?

    Regards Frost
      Configuration Apache + Modx + MSSQL 2008
      ===============================
      Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.8
      OS : Windows 2008 R2
      SGBDR : Microsoft SQL Server 2008 (express)
      • 34123
      • 103 Posts
      Heheheh,

      After some research here is the correct result :

             <dc:date>[[+publishedon:strtotime:date=`%Y-%m-%dT%H:%M:%S-01:00`]]</dc:date>
      


      Here is the complet stuff to do RSS 1.0 feed :

      Main feed, Document Type : RSS
      <?xml version="1.0" encoding="UTF-8"?>
      <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">
        <channel rdf:about="[[++site_url]]">
          <title>[[++site_name]] - [[*pagetitle]]</title>
          <link>[[++site_url]]</link>
          <dc:language>fr</dc:language>
          <description>[[++site_modo]]</description>
          <image rdf:resource="[[++site_url]]assets/templates/technoblog/images/logo.gif" />
      
      <items>
       <rdf:Seq>
      [[!getResources? 
         &parents=`2`
         &limit=`10`
         &sortby=`createdon`
         &sortdir=`DESC`
         &includeTVs=`1`
         &tpl=`tblRssTableLightListing`
      ]]
       </rdf:Seq>
      </items>
      </channel>
      
      [[!getResources? 
         &parents=`2`
         &limit=`10`
         &sortby=`createdon`
         &sortdir=`DESC`
         &includeTVs=`1`
         &tpl=`tblRssLightListing`
      ]]
      </rdf:RDF>
      


      tblRssTableListing
         <rdf:li rdf:resource="[[++site_url]][[~[[+id]]]]" />
      


      tblRssListing
          <item rdf:about="[[++site_url]][[~[[+id]]]]">
             <title>[[+pagetitle]]</title>
             <link>[[++site_url]][[~[[+id]]]]</link>
             <description>[[+introtext]]</description>
             <dc:creator>[[+publishedby:userinfo=`username`]]</dc:creator>
             <dc:date>[[+publishedon:strtotime:date=`%Y-%m-%dT%H:%M:%S+02:00`]]</dc:date>
             <dc:subject>[[+tv.tblTag]]</dc:subject>
          </item>
      


      It has been validated with python-feedvalidator
        Configuration Apache + Modx + MSSQL 2008
        ===============================
        Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.8
        OS : Windows 2008 R2
        SGBDR : Microsoft SQL Server 2008 (express)