ForceTemplate 1.0.3-pl

ForceTemplate 1.0.3-pl

Released Sep 18, 2018 by kudashevs

MODx Revolution plugin which force set of given template for all newly created resources in given parents. Component allows find duplicated parent ids in rules. If non-existent template is given in rules the log message will be generated and new document will get parent template.

Download 29kb (25 downloads)
Downloads: 41
License: GPLv2
Requires Revolution 2.3.x or greater
Supports mysql

MODx Revolution plugin which force sets given template for all newly created resources in given parents.

Component work with "Quick Create" menu, allow specify an id or full template name in rules and support nesting/multi-level usage. If parent duplicates in rules, the last rule will be applied. You can find duplications with parents_check option. If non-existent template is given in the rule new document will get parent template and log notification will be generated. If nesting level is not specified in the rule, nesting level will be 1, it means the current parent.

After installation use System settings forcetemplate namespace to set preferable settings values.

  • rules - rule of usage in format "parent_id:template:level" delimited by pipe (|) or double pipe (||). Example: 3:1|4:my template:5.
  • quick_create - allow to turn on/off force set of given template to "Quick Create" menu in document tree. Default true.
  • parents_check - check parents ids in rule for duplication with log error if yes. Default false.

Feel free to suggest ideas/improvements/bugs on GitHub:

https://github.com/kudashevs/ForceTemplate/issues

Installation Instructions

After installation use System settings forcetemplate namespace to set preferable settings values.

Usage example: Determine the desired parent and the level of nesting, if there is a desire to use it. The default nesting level is 1. In System settings choose forcetemplate namespace and fill the field with rules (rules). For example, we need to set two rules:

  • There is a parent with id 3 with 1-st level of nesting and a template with id 1, then you need to specify 3:1.
  • There is a parent with id 4 with nesting level 5 and the template "my
    template" (lazy to look for id), then you need to specify: 4:my
    template:5.

To combine these rules and use them together, combine them via pipe (|) or double pipe (||).

1.0.3-pl==============
  • Add "Quick Create" menu support
  • Add component usage example
  • Some refactoring and improvements
1.0.2-pl==============
  • Add multi-level functionality
  • Some refactoring and improvements
1.0.1-pl==============
  • Add choose template by name
  • Remove template_check option
  • Some improvements
1.0.0-pl==============
  • Initial release
Version Released Author Downloads
3 Versions 1 Contributors 41 Downloads
1.0.2-pl Sep, 18 2018 kudashevs 5
1.0.1-pl Sep, 18 2018 kudashevs 11