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 | |
/** | |
* This is a MODX snippet to add "new" or "Updated" images to menu, | |
* pages and such. | |
* You need to provide your own new.gif and updated.gif file. change the | |
* file path to the images files accordingly. | |
* if called without input parameter then it will look at the page resource and | |
* determine if the page is newly published or updated. | |
* if called with input=`resourceID` then it will look into that resource ID. | |
* This snippet can be also used with getResoruces or Wayfinder. |
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 | |
// Use this line to prevent people from hammering your server. | |
if (!isset($_GET['super_secret']) || ($_GET['super_secret'] != 'secretpassword')) return 'Not authorized'; | |
// Call this snippet uncached in a resource with template "empty": | |
// content: "[[!benchmark]]" | |
// Make sure to tag the resource as uncachable | |
// The intro | |
echo '<body style="font-family: sans-serif;">'; |
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 | |
/** | |
* MODX FormLog hook to store formIt data in a jSon log file | |
* | |
* @author Kilian Bohnenblust (sofasurfer.org) | |
* @example [[!FormIt? | |
* &hooks=`spam,formlog,email,redirect` | |
* &logfile=`[[++base_path]]assets/data/form-contact.log` | |
* | |
*/ |
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 | |
// Use with OnLoadWebDocument | |
// Checks if in an Ajax call is made by checking if the value in X-Requested-With is given in the header. | |
if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { | |
$modx->documentContent = '[*content*]'; | |
} | |
?> |
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 | |
$adminId = 1; | |
$polisyID = 4; | |
$authorityLevel = 9999; | |
$extendedField = 'redirect'; | |
//resorce setings | |
$template = 1; | |
$parent = 2; | |
$published = 1; |
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 | |
/* | |
snippet2placeholder | |
by Bruno17 | |
http://www.modxcms.de/forum/comments.php?DiscussionID=5524#Item_4 | |
Create placeholder from a snippet, for example wayfinder | |
[[snippet2placeholder? | |
&snippet=`Wayfinder` | |
&startId=`1` |
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
<p>Hi there!</p> | |
<p>The resource [[+pagetitle]] (ID: [[+id]]) has been [[+mode]].</p> | |
<p>You can login to the manager at www.mysite.com/manager/ to review and if needed publish the resource.</p> | |
<p>Thank you!</p> |
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 | |
/** | |
* getYears | |
* List up years from a given start untill the current year or given end year. | |
* Example: [[!getYears? &tpl=`yourChunk` &startYear=`2000`]] | |
* | |
* Properties: | |
* tpl - (Req.) The name of the chunk to use for each year entry | |
* outerTpl - (Opt.) The name over the outer chunk. Use a [[+wrapper]] placeholder. | |
* outputSeparator - (Opt.) Separate the output with this contents. Defaults a newline |
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 | |
/** | |
* ========================= | |
* defaultTemplateByParentTv | |
* ========================= | |
* | |
* Plugin for modX Revolution | |
* Set default template for children of a ressource | |
* | |
* Author: |
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 | |
/** | |
* FirstChildId | |
* Gets the first child id of the given id. Works as output filter. | |
* Example use: [[*id:FirstChildId]] | |
* | |
* @autor Bert Oost at OostDesign.nl <[email protected]> | |
*/ | |
$id = (!empty($input)) ? $input : false; |