We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7575
    • 85 Posts
    is there a way to make an rss feed for the document you create with getResources/getPage ?

      www.tornooi.net online database for (sport) events in dutch.
      To be redesigned, rewritten to modx with multiple languages...
      ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
      • 28215
      • 4,149 Posts
      Yes.

      Create a Resource with a Content Type of RSS, and this content:

      
      <?xml version="1.0" encoding="UTF-8"?>
      <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
          <title>MY TITLE HERE</title>
          <link>[[++site_url]][[~[[*id]]]]</link>
          <description>[[*description:cdata]]</description>
          <language>en</language>
          <copyright>Copyright 2010 by MY NAME HERE. All Rights Reserved.</copyright>
          <ttl>120</ttl>
          <atom:link href="[[++site_url]][[~[[*id]]]]" rel="self" type="application/rss+xml" />
           
           [[!getResources?
        &parents=`IDS OF RESOURCES HERE`
        &tpl=`rssItem`
        &limit=`10`
        &includeContent=`1`
        &includeTVs=`1`
        &showHidden=`0`
        &hideContainers=`1`
      ]]
      
      </channel>
      </rss>
      

      And use a chunk called ’rssItem’ for the tpl with this content:

      <item>
          <title>[[+pagetitle]]</title>
          <link>[[++site_url]][[~[[+id]]]]</link>
          <description>[[+introtext:cdata]]</description>
          <pubDate>[[+publishedon:strtotime:date=`%a, %e %b %Y %H:%M:%S %z`]]</pubDate>
          <guid>[[++site_url]][[~[[+id]]]]</guid> 
          <author>[[+createdby:userinfo=`email`]] ([[+createdby:userinfo=`fullname`]])</author>
          <category>[[+tv.tags]]</category>
      </item> 
      
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 7575
        • 85 Posts
        tnx, got it to work

        but maybe good to know for others:

        put

        <?xml version="1.0" encoding="UTF-8"?>
        <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
        <channel>
        
        [[*content]]
        
        </channel>
        </rss>

        in a new template (RSS) and the remainder in the Resource with a Content Type of RSS
          www.tornooi.net online database for (sport) events in dutch.
          To be redesigned, rewritten to modx with multiple languages...
          ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          You may want to look into this one as it notes fixes for cdata and such: http://modx360.com/blog/2010/02/getresources-rss-feed.html

            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 28215
            • 4,149 Posts
            Note also there’s a :cdata output filter built into Revo, that you can use to wrap a tag’s output with CDATA tags, such as [[+content:cdata]].
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 1343 ☆ A M B ☆
              • 2,213 Posts
              Quote from: splittingred at Aug 08, 2010, 07:49 PM

              Note also there’s a :cdata output filter built into Revo, that you can use to wrap a tag’s output with CDATA tags, such as [[+content:cdata]].

              Hum.... So we can take [[+introtext:toCDATA]] and make it [[+introtext:cdata]]. Super! Now if only there was a URL Encoding function....
                Patrick | Server Wrangler
                About Me: Website | Tweets |  MODX Hosting
                • 28215
                • 4,149 Posts
                Actually, there is...the documentation doesn’t list all the filters. I need to update it.

                [[+string:urlencode]]
                
                [[+anencodedstring:urldecode]]
                


                You can see all the filters in the code here, for now: http://github.com/modxcms/revolution/blob/master/core/model/modx/filters/modoutputfilter.class.php
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 1343 ☆ A M B ☆
                  • 2,213 Posts
                  Quote from: splittingred at Aug 08, 2010, 09:41 PM

                  Actually, there is...the documentation doesn’t list all the filters. I need to update it.

                  [[+string:urlencode]]
                  
                  [[+anencodedstring:urldecode]]
                  


                  You can see all the filters in the code here, for now: http://github.com/modxcms/revolution/blob/master/core/model/modx/filters/modoutputfilter.class.php

                  ... I was looking for that last night and found it hard to believe that wasn’t included... Well looks like you’ve shaken up my world again! Back to fun and games smiley
                    Patrick | Server Wrangler
                    About Me: Website | Tweets |  MODX Hosting
                    • 21635
                    • 81 Posts
                    hi, i’m using the above-mentioned solution to provide rss-feeds.

                    i wondered, why safari didn’t render the rss-icon in the adress-bar, although there was a link directing to the rss-document within the page.

                    then i checked the rss-resource in the manager and found, that it displayed content-type "html", although i clearly saved the resource with content type rss.

                    searched jira, found http://bugs.modx.com/browse/MODX-2097.

                    seems to be a similar issue.

                    nevertheless, when i click the http://site.com/site.rss-link within a page, i get successfully directed to a feed:// page.
                      • 22303 MODX Staff
                      • 10,725 Posts
                      So if you reload the edit page on the Resource, does it still show your RSS content type or HTML?