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 | |
//Отображение названия родительской категории | |
//[[+parent:getThisField=`pagetitle`]] | |
$parent = $modx->getObject('modResource',$input); | |
$field = $parent ->get($options); | |
return $field; |
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. Включение плагина по событию onWebPagePreRender | |
$output = &$modx->resource->_output; | |
$output = preg_replace('|\s+|', ' ', $output); | |
$modx->resource->set('content', $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
<?php | |
//copyrightYear | |
//Automatic Copyright Year Snippet for MODx Revolution | |
//Use: [[copyrightYear?firstYear=`2015`]] | |
//Use: Copyright [[AutoCopyYear?firstYear=`2014`]] - Sitename | |
//Use: Copyright [[AutoCopyYear]] - Sitename | |
$year = date('Y'); | |
$firstYear = isset($firstYear)? $firstYear : $year; | |
$years = ($year > $firstYear) ? $firstYear.' - '.$year : $year; |
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 | |
/* | |
* copyrightYear: get years to copyright footer | |
* Parameters: | |
* start [optional]: First year of website. | |
* DEFAULT: nothing. | |
* separator [optional]: the space string between start and current year | |
* [[copyrightYear]] // return: 2016 | |
* [[copyrightYear? &start=`2014`]] // return: 2014 – 2016 | |
*/ |