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
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?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
<?php | |
$img_src = $modx->getOption('src', $scriptProperties); | |
$img_alt = $modx->getOption('alt', $scriptProperties); | |
$img_width = $modx->getOption('width', $scriptProperties,640); | |
$is_lazy = $modx->getOption('lazy', $scriptProperties, false); | |
$img_class = $modx->getOption('class', $scriptProperties, 'img-fluid'); | |
$colums = $modx->getOption('cols', $scriptProperties, '{"xs":12,"sm":12,"md":8,"lg":6,"xl":6}'); | |
$img_type = $modx->getOption('type', $scriptProperties, 'jpg'); | |
$dataAttr = ''; |
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 | |
# Edited GIST based on: https://community.modx.com/t/better-way-to-access-formit-form-data/6828 | |
/** | |
* Snippet to get formit forms by name | |
* usage: | |
* [[!getFormitForm? &name=`Name of form`]] | |
*/ | |
/** |
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
[[!+nowdate:default=`now`:strtotime:date=`%Y`]] |
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
# Redirect to www and force HTTPS | |
#add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; | |
if ($scheme != "https") { | |
rewrite ^ https://$host$uri permanent; | |
} | |
# www.mydomain.com -> mydomain.com | |
# if ($host = "www.mydomain.com") { | |
# return 301 $scheme://mydomain.com$request_uri; |
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
{ | |
"theme": "inlite", | |
"inline": true, | |
"plugins": "modxlink image imagetools media lists hr code visualblocks table", | |
"insert_toolbar": "image media quicktable modxlink hr", | |
"selection_toolbar": "styleselect fontsizeselect | alignleft aligncenter alignright bullist numlist | quickimage media table modxlink | undo redo removeformat | visualblocks code", | |
"image_advtab": true, | |
"imagetools_toolbar": "editimage imageoptions | alignleft aligncenter alignright | rotateleft rotateright | flipv fliph | removeformat code", | |
"image_class_list": [ | |
{ |
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 | |
/** | |
* SessionManager | |
* A script that can be used for easy control over your session variables. | |
* Put this script in your core/components/ folder, inside a sessionman/ subdirectory. | |
* | |
* Load this one in your snippets/plugins like; | |
* | |
* $sessman = $modx->getService('session','SessionManager', $modx->getOption('sessman.core_path',null,$modx->getOption('core_path').'components/sessionman/'), $scriptProperties); | |
* if(!($sessman instanceof SessionManager)) { $modx->log(modX::LOG_LEVEL_ERROR, 'Session manager could not be loaded..'); return ''; } |