|Only use this documentation for pre-2.2 or core submissions.|
Refer to the Adding a Custom TV Type doc for the proper way to build custom TVs in 2.2 which allows easy packaging.
MODx Revolution allows you to create your own custom TV input types (similar to the textbox, radio, textarea, richtext, etc types already available) for your Template Variables.
To create a custom TV input type (let's say, one called "test"), you need a few things. Let's say my "test" TV input type loads a Template selecting combobox.
I'd first need 2 files:
- An input controller - put here: core/model/modx/processors/element/tv/renders/mgr/input/test.php
- An input template - put here: manager/templates/default/element/tv/renders/input/test.tpl
The input controller, test.php, would have:
And the input template, test.tpl, for the default mgr theme would have (note that it is using Smarty syntax):
And there you go! A custom TV input type.
|You don't have to use the ExtJS code as shown here to have a custom input type. It could even just be a straight HTML input. It's really up to you.|