Skip to content

Instantly share code, notes, and snippets.

View MODx number of Tickets comments
if ($thread = $modx->getObject('TicketThread', array('resource' => $id))) {
echo $thread->get('comments');
View minishop2 MODx gallery thumbnail's size
View BannerY MODx setup position in template
&tpl=`@INLINE <a href="[[+url]]" target="_blank"><img src="[[+image]]" alt="[[+name]]" class="img-responsive" title="[[+description]]"></a>`
View Hide Robots.txt use htaccess
Options +FollowSymlinks
RewriteBase /
RewriteRule ^robots.txt$ /robot.php?%{REQUEST_URI}
View VersionX db clean
* versionCleanX
* @author Scott Pronych, September 27, 2013
* For use with VersionX to delete old content
View Получение заголовка видео с youtube
if ($mode == 'new') {
if (strpos(trim($resource->pagetitle), ' ') === false) {
$url = '' . $resource->pagetitle;
$html = file_get_contents($url);
$dom = new DomDocument();
$dom->loadHTML('<?xml version="1.0" encoding="UTF-8"?>'. $html);
if ($title = $dom->getElementById('eow-title')) {
$modx->log(1, $resource->pagetitle);
$video_id = $resource->pagetitle;
View Подгрузка статей кнопкой с помощью pdoPage
<div class="news-items" id="newsItems">
<div class="rows" style="overflow: hidden;">
View Разбивка страниц по категориям (родителям)
<div id="pdopage">
<div class="rows">
&sortby=`{"p_menuindex":"ASC", "publishedon":"DESC"}`
View Как вывести только контейнеры MODX
"modResource":"id, pagetitle",
"Children":"COUNT( as count"
"Children":{"class":"modResource", "on":" = Children.parent"}
ru2fac / Bootstrap
Created November 6, 2018 00:37
Сообщение об успешной отправке AjaxForm в модалке на Fancybox
View Bootstrap
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="successModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="successModalLabel">Спасибо</h4>
<div class="modal-body">