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 | |
//[[clearfix? &idx=`[[+idx]]` &tpl=`<div class="clearfix visible-sm-block"></div>` &n=`2`]] | |
if(($idx % $n) == 0) echo $tpl; |
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
<? | |
$new_res = $modx->newObject('modResource', $resource_data); | |
$alias = $new_res->cleanAlias($title); |
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 | |
// Dan Gibbs | |
// Clear MODx Revolution Cache (2.1 and later) | |
// Path to MODx Core Directory | |
define("MODX_CORE_PATH", "../core/"); | |
define("MODX_CONFIG_KEY", "config"); | |
// Include MODx main class | |
include(MODX_CORE_PATH . "model/modx/modx.class.php"); |
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
Приложения: | |
TinyMCE Rich Text Editor | |
Ace | |
FormIt | |
pdoTools | |
translit | |
filetranslit | |
pthumb | |
FetchIt | |
MIGX |
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 | |
// Работаем только на фронтенде и только с friendly urls | |
if ($modx->event->name != 'OnHandleRequest' || $modx->context->key == 'mgr' || !$modx->getOption('friendly_urls')) {return;} | |
// Получаем запрашиваемый url | |
$alias = $modx->getOption('request_param_alias', null, 'alias', true); | |
$request = &$_REQUEST[$alias]; | |
// Выбираем контексты с настройкой base_url | |
$q = $modx->newQuery('modContextSetting', array('key' => 'base_url', 'value:!=' => '')); |
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
_____________________________________________________________ | |
1. Настройки контекстов | |
--- Контекст: web --- | |
Общая информация: | |
Ключ: web | |
Имя: Русский | |
Описание: Русский | |
Настройки контекста: |
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
var mediaItemContainer = $( '#container' ); | |
mediaItemContainer.masonry( { | |
columnWidth: '210px', | |
itemSelector: '.item' | |
} ); | |
$( mediaItemContainer ).prepend( '<div class="item">foo</div>' ); | |
$( mediaItemContainer ).masonry( 'reloadItems' ); | |
$( mediaItemContainer ).masonry( 'layout' ); |
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
jQuery.fn.extend({ | |
hideOther: function(num){ | |
var elem = $(this); | |
$(elem).wrapAll('<div class="other-all-outer"></div>').attr('data-num', 2).after('<div class="more-btn btn btn-transparent">Загрузить еще</div>').children('.item').slice(num).wrapAll('<div class="other-all"></div>').parent().hide(); | |
$(this).closest('.other-all-outer').find('.more-btn').on('click', function(e){ | |
e.preventDefault(); | |
var offset_num = parseInt($(elem).data('num')), | |
count = num * offset_num; | |
$(this).closest('.other-all-outer').find('.other-all').children('.item').unwrap(); | |
offset_num++; |
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 | |
// сниппет resourcesList | |
// можно формировать по parent и по template | |
// в возможных значениях tv: @EVAL return $modx->runSnippet('resourcesList', array('template'=>17)); | |
$q = $modx->newQuery('modResource'); | |
$q->select(array( | |
'modResource.id as id', |