- Создаём страницу типа XML с пустым шаблоном, в содержимое пихаем
Содержимое страницы.xml
и указываем в &parents id ресурсов откуда выводить материал - Добавляем сниппет
htmlspecialchars
с кодом изhtmlspecialchars.php
для экранизации символов и добавление полного пути к картинкам, указываем папку с картинками - Добавляем чанк
tpl_turborss
с кодом изrss_tpl.tpl
для вывода элементов, заменяем код для вывода картинок на нужные tv и тд
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 $payment.id != 1 } | |
<form action="https://money.yandex.ru/eshop.xml" method="post"> | |
<input name="shopId" value="" type="hidden"/> | |
<input name="scid" value="" type="hidden"/> | |
<input name="sum" value="{$total.cost | replace : ' ' : '' | number : 2 : '.' : ''}" type="hidden" min="1"> | |
<input name="customerNumber" value="{$address.phone}" type="hidden"/> | |
<input name="orderNumber" value="{$order.num}" type="hidden"/> | |
<input name="custAddr" value="{$order.address}" type="hidden"/> | |
<input name="cps_phone" value="{$address.phone}" type="hidden"/> | |
<input name="cps_email" value="{$user.email}" type="hidden"/> |
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
<?php | |
// Параметры | |
// $html = ''; Вывод с html | |
// $need = ''; Что нужно вывести, телефон или тд | |
if (!$need) | |
$need = 'phone'; // По умолчанию выводим телефон | |
$arrParam = array( | |
'google' => array( | |
'title' => 'Google good!', |
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
<?php | |
$context = $modx->context->get('key'); | |
if ($context == 'mgr' || empty($_POST['quick_order']) || empty($_POST['id']) || empty($_POST['customer'])) { | |
return; | |
} | |
/** | |
* @var miniShop2 $miniShop2 | |
*/ | |
$miniShop2 = $modx->getService('minishop2'); | |
$miniShop2->initialize($context, array( |
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
<?php | |
// Создаём снипет, например geolocation | |
// тут его содержимое, а выводим его так | |
// [!geolocation? &need=`phone` &html=`1`!] | |
// $need - Запрос на вывод | |
if (!$need) | |
$need = 'phone'; // По умолчанию выводим телефон | |
// Нужные параметры | |
$cityDefault = 'Санкт-Петербург'; # город по умолчанию |
- Создаём страницу, тип содержимого XML, шаблон пустой, содержимое в файле
содержимое страницы.xml
где заменяем tv поля для картинки под нужное, и заменяем id 3 на те ресурсы которые нужно выводить - Создаём сниппет
htmlspecialchars
с содержимымhtmlspecialchars.php
для экранизации тегов и замены путей картинок на полные, нужно в сниппете указать путо до картинок - Создаём чанк
rss.item
для вывода результатов, содержимое для него в файлеrss.item.tpl
где заменяем если нужно tv поля для вывода картинок
- Данный способ выводить 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
/*_____________________ VeryLazy ______________________*/ | |
// - Подгрузка изображений в блоках при их показе на экране | |
block_selector = '.home ._block'; // Селектор блоков | |
function VeryLazy(){ | |
if ($('html').hasClass('webp')) { | |
$(document).find(block_selector).each(function(index, element){ | |
if ($(document).scrollTop() > $(this).offset().top - $(window).height()){ | |
$(this).addClass('active').find('img[data-src],img[data-webp]').each(function() { | |
if ($(this).data().webp) |
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
<?php | |
if (empty($parent)) {$parent = $modx->resource->id;} | |
$pids = array_merge(array($parent), $modx->getChildIds($parent)); | |
$ids = array(); | |
$q = $modx->newQuery('msProduct'); | |
$q->where(array('class_key' => 'msProduct','parent:IN' => $pids,'published' => 1,'deleted' => 0)); | |
$q->select('`msProduct`.`id`'); | |
if ($q->prepare() && $q->stmt->execute()) { | |
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN); |
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
<?php | |
# Должно быть включено системное событие OnWebPageInit | |
// $modx->log(modX::LOG_LEVEL_ERROR, print_r($_GET,1)); | |
if (isset($_GET['teg'])){ | |
$return = false; | |
$arrTags = explode(',', $_GET['teg']); | |
if (count($arrTags) > 1){ | |
# Если больше 1 тега то возвращяем 404 | |
$return = true; |