This file contains 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 | |
/** | |
* getResources | |
* | |
* A general purpose Resource listing and summarization snippet for MODx 2.0. | |
* | |
* @author Jason Coward | |
* @copyright Copyright 2010, Jason Coward | |
* @version 1.2.2-pl - October 18, 2010 | |
* |
This file contains 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 | |
$modx->sendRedirect($modx->makeUrl($id, '', '', 'full')); |
This file contains 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
@EVAL return $modx->runSnippet('getAside'); |
This file contains 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
$criteria = $modx->newQuery('modResource'); | |
$criteria->where(array( | |
'parent' => $modx->resource->get('id'), | |
'published' => 1, | |
'deleted' => 0, | |
)); | |
$criteria->sortby('pagetitle','ASC'); | |
$children = $modx->resource->getMany('Children',$criteria); | |
foreach($children as $var => $value) | |
{ |
This file contains 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 we are in context www-en… | |
if ($modx->context->get('key') == "www-en") { | |
$o = ''; | |
// …grab www-fr infos | |
$modx->switchContext('www-fr'); | |
$ss = $modx->getOption('site_start'); | |
$ctx = $modx->context->get('key'); | |
// grab datas from TV named multi (containing ID of the translated resource) | |
$tvv = $modx->resource->getTVValue('multi'); |
This file contains 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
[[simpleSearch? | |
&tpl=`SearchResult` | |
//The chunk that will be used to display the contents of each search result. | |
&containerTpl=`SearchResults` | |
//The chunk that will be used to wrap all the search results, pagination and message. | |
&useAllWords=`0` | |
//If true, will only find results with all the specified search words. | |
&maxWords=`7` | |
//The maximum number of words to include in the search. Only applicable if useAllWords is off. | |
&searchStyle=`partial` |
This file contains 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
&where=`{ "template:IN" : [ 1,2,3 ] } | |
&where=`{ "template:NOT IN" : [ 1,2,3 ] } | |
&where=`{{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}}` (source: http://modxcms.com/forums/index.php?topic=52307.0) |
This file contains 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
[[ (opening tags) | |
! (optional non-cacheable flag) | |
elementToken (optional token identifying the element type if it's not a snippet, $=chunk, *=resource field/tv, +=placeholder, etc.) | |
elementName | |
@propertyset (optional PropertySet identifier) | |
:filterName=`modifier`:... (optional one or more output filters) | |
? (optional; indicates beginning of property string) | |
&propertyName=`propertyValue` &... (optional; any additional properties separated by &) | |
]] (closing tags) |
This file contains 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
[[!Wayfinder? | |
&removeNewLines=`0` | |
&where=`` | |
&hereId=`` | |
&templates=`` | |
&config=`` | |
&StartId=`0` | |
&level=`1` | |
&includeDocs=`` |
This file contains 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
[[!getResources? | |
&parents=`` | |
&resources=`` | |
&depth=`0` | |
&tvFilters=`` | |
&sortby=`menuindex` | |
&sortbyAlis=`` | |
&sortbyEscaped=`` | |
&sortdir=`ASC` | |
&limit=`` |