• MODX.com



insert is an extra by sepiariver, first released on 2013-07-23.

Package Description

Initial beta release.

Usage/Installation Instructions

This simply registers a CSS file and some HTML before the closing body tag. <code>[[insert? &css=`path/to/cssFile.css` &htmlAtClose=`<footer>No copyright. Do as you wish.</footer>`]]</code> This registers a JS file before the closing body tag only for the User whose ID is `1`. <code>[[insert? &jsAtCloseForUser=`assets/devJs.js` &userId=`1` &mode=`dev`]]</code> This registers devCssFile.css for Manager Users and cssFile.css for others. The &mode property must be set to `dev` for this result. <code>[[!insert? &css=`path/to/cssFile.css` &cssForUser=`path/to/devCssFile.css` &mode=`dev`]]</code> **NOTE: in order to use `dev` or `override` modes, the Snippet MUST be called UNcacheable in order to check for a valid session on each request. This is not recommended for production. If sessions are not required, call the Snippet cached for best performance, taking care NOT to enable `dev` mode, therby potentially caching the `dev` mode results. PARAMETERS: &context Context key, or comma separated list of Contexts to check against valid Users (those who will see the alternate content). Required. Default: 'mgr' (Users logged into the Manager will see the alternate content) &mode 'production', 'dev' or 'override'. Set this to display alternate content to Users with a valid session. Default: 'production' (Users will see the same content as Anonymous) &userId Optionally specify a MODX User ID for whom to display alternate content. All others will only see production content. &css (and $cssForUser) Path the css file to register. $jsInHead (and $jsInHeadForUser) Path the js file to register in the head element. $htmlInHead (and $htmlInHeadForUser) Markup to insert in the head element. $jsAtClose (and $jsAtCloseForUser) Path the js file to register at the end of the body element. $htmlAtClose (and $htmlAtCloseForUser) Markup to insert at the end of the body element.


First seen
Supported databases
Minimum MODX Requirement

insert Releases

Vendor Signature Released on
MODX.com 1.0.0-beta1 2013-07-23 (5 years ago)