SwitchTemplate 1.2.0-pl2

SwitchTemplate 1.2.0-pl2

Released Sep 12, 2017 by jako

Switch resource templates on the fly.

Download 1283kb (57 downloads)
Downloads: 1,756
License: GPLv2
Requires Revolution 2.3.x or greater
Supports mysql

SwitchTemplate changes the template of a MODX resource on the fly with a request parameter. Different settings with different setting keys could be set in a custom manager page.

With each setting a different template could be used to output the resource. As well the template type could be set to chunk or template. If the template type is chunk the resource variables and template variables are prepared as placeholder before the chunk is parsed. The caching of the output of SwitchTemplate could be enabled for each separate setting. The output is cached separate for each resource and each setting. Each setting could be enabled or disabled for selected resources. The output could be filtered to valid AMP markup.

SwitchTemplate could be used for different purposes: As Ajax connector, as language switcher, AMP output ...

For full details, see the SwitchTemplate documentation

This project is hosted on GitHub: https://github.com/Jako/SwitchTemplate

Installation Instructions

MODX Package Management

  • Switch the template on base of the extension
  • $modx->RegClient methods are executed in switched templates with HTML output
  • Filter the page source before output i.e. for AMP output
  • Absolute links & images and image width & height attributes in AMP output
  • Switched template/chunk name on base of the original template name
  • Set the allowed SwitchTemplate modes in a template variable

Version Released Author Downloads
6 Versions 1 Contributors 1,759 Downloads
1.2.0-pl Sep, 08 2017 jako 23
1.1.0-pl Mar, 10 2015 jako 1,026
1.0.1-pl Oct, 21 2014 jako 388
1.0.0-pl2 Sep, 27 2014 jako 146
1.0.0-pl Sep, 26 2014 jako 119