Package Description
AddHeaderfiles is an elegant tool for MODX Revolution. With this tool the MODX regClient functions are used to insert Javascript and CSS styles at the appropriate positions of the current page. Since those functions don't insert the same filename twice, the snippet could be called everywhere in the template, document or in chunks to collect all needed Javascripts and CSS styles together.
Works well with minifyRegistered.
Usage/Installation Instructions
Parameters:
- addcode - External filenames(s) or chunkname(s) separated by `sep`. These external files can have a position setting or media type separated by `sepmed`
- sep - Separator for files/chunknames (default ';')
- sepmed - Seperator for media type or script position (default '|')
- mediadefault - Media default for css files (default 'screen, tv, projection')
Example Calls (anywhere in the document or template):
Direct call:
[[!AddHeaderfiles?addcode=`/assets/js/jquery.js;/assets/js/colorbox.js|end;/assets/css/colorbox.css;/assets/css/test.css|print`]]
Chunk call:
Fill a chunk (i.e. 'headerColorbox') like this:
/assets/js/jquery.js;/assets/js/colorbox.js|end;/assets/css/colorbox.css
[[!AddHeaderfiles?addcode=`headerColorbox`]]
Parts of the addcode parameterchain could point to chunks (recursive). The parts of the chain that are not pointing to other chunks or to files/uri should contain the complete script or css code.
[[!AddHeaderfiles?addcode=`headerColorbox;/assets/css/test.css|print`]]
Full documentation on https://github.com/Jako/AddHeaderfiles-revo
Details
- Developer(s)
- jako
- Released
- 2013-07-18
- First seen
- 2013-07-18
- License
- GPLv2
- Supported databases
- MySQL
- Minimum MODX Requirement
- 2.2
AddHeaderfiles Releases
Vendor | Signature | Released on |
---|---|---|
MODX.com | 0.6.1-pl | 2013-10-21 (11 years ago) |
MODX.com | 0.6-pl | 2013-07-18 (11 years ago) |