- Создаём страницу типа XML с пустым шаблоном, в содержимое пихаем
Содержимое страницы.xml
и указываем в &parents id ресурсов откуда выводить материал - Добавляем сниппет
htmlspecialchars
с кодом изhtmlspecialchars.php
для экранизации символов и добавление полного пути к картинкам, указываем папку с картинками - Добавляем чанк
tpl_turborss
с кодом изrss_tpl.tpl
для вывода элементов, заменяем код для вывода картинок на нужные tv и тд
Last active
July 7, 2019 20:33
-
-
Save TrywaR/627049950d86d7c725fe79a92b24ab38 to your computer and use it in GitHub Desktop.
MODX Evo > RSS для турбо-страниц хуяндекса
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
if (isset($content)){ | |
$image_path = 'images'; # Папка с картинками | |
$output = str_replace( 'src="'.$image_path, 'src="[(site_url)]'.$image_path, $content ); | |
$output = str_replace("\r\n", "", $output); | |
$output = htmlspecialchars($output); | |
return $output; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<item turbo="true"> | |
<title>[+rss_pagetitle+]</title> | |
<link>[(site_url)][~[+id+]~]</link> | |
<description> | |
<![CDATA[ [+introtext+] ]]> | |
</description> | |
<pubDate>[+rss_date+]</pubDate> | |
<turbo:content> | |
<header> | |
[[if? &is=`[*img*]:not_empty:or:[*imge*]:not_empty` &then=` | |
<figure> | |
<img src="[+img:default=`[+imge+]`+]" /> | |
</figure> | |
`]] | |
<h1> | |
[+pagetitle+] | |
</h1> | |
</header> | |
<description> | |
[[htmlspecialchars? &content=`[+content+]`]] | |
</description> | |
</turbo:content> | |
<guid isPermaLink="false">[(site_url)][~[+id+]~]</guid> | |
</item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[!Ditto? | |
&parents=`67,163` | |
&format=`rss` | |
&total=`all` | |
&tpl=`rss_tpl` | |
&display=`10` | |
!] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment