RSSフィードの作成にはgetResourcesを使用します。
<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>[[*pagetitle:htmlent]]</title> <link>[[~[[*id]]? &scheme=`full`]]</link> <description>[[*introtext:cdata]]</description> <language>[[++cultureKey]]</language> <ttl>120</ttl> <atom:link href="[[~[[*id]]? &scheme=`full`]]" rel="self" type="application/rss+xml" /> [[getResources? &tpl=`rssItem_tpl` &parents=`29,41` &depth=`5` &limit=`10` &includeContent=`1` &includeTVs=`1` &showHidden=`0` &hideContainers=`1` ]] </channel> </rss>
前述のコードで getResources は rssItem_tpl というテンプレートを参照していますので、rssItem_tpl と言う名前でchunkを作成します。 テンプレートの中身は以下の通りです。
<item> <title>[[+pagetitle:htmlent]]</title> <link>[[++site_url]][[~[[+id]]]]</link> <description> [[+introtext:default=`[[+content:ellipsis=`600`]]`:cdata]] </description> <pubDate>[[+publishedon:strtotime:date=`%a, %d %b %Y %H:%M:%S +0900`]]</pubDate> <guid isPermaLink="false">[[++site_url]][[~[[+id]]]]</guid> <dc:creator> [[+createdby:userinfo=`fullname`]] </dc:creator> </item>
以下の行をheaderに追加することで、RSSアイコンがアドレスバーに表示されます。
<link rel="alternate" type="application/rss+xml" title="RSSフィード" href="[[~52]]" />
実際に使用しているのが、こちらの株式会社ルーキー/RSS フィード、ルーキータッチ/RSSフィードページです