[REVO][HowTo] Создаем rss ленту с помощью getResources

alica

Гуру форума
Регистрация
28 Июл 2008
Сообщения
243
Реакции
76
Устанавливаем getResources и создаем страницу для rss. Выбираем тип страницы "XML" и убираем шаблон.
Код страницы:
Код:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
    <title>[[++site_name]]</title>
    <link>[[++site_url]][[~[[*id]]]]</link>
    <description>[[*description:cdata]]</description>
    <language>ru</language>
    <copyright>Copyright 2011 by [[++site_name]]. All Rights Reserved.</copyright>
    <ttl>120</ttl>
    <atom:link href="[[++site_url]][[~[[*id]]]]" rel="self" type="application/rss+xml" />
     [[!getResources?
  &parents=`Папка откуда будут подтягиваться страницы`
  &tpl=`template_rssItem`
  &limit=`10`
  &includeContent=`1`
  &includeTVs=`1`
  &showHidden=`0`
  &hideContainers=`1`
]]
</channel>
</rss>
Создаем чанк template_rssItem. И код чанка:
Код:
<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=`fullname`]]</author>
</item>
 
Назад
Сверху