I’m developing my custom plugin (not extra that you need to install) to add some custom template variables into each modx site that I’m working with. I have followed this tutorial Custom Template Variables - Extending MODX | MODX Documentation - and so far everything is working fine, i have my first custom template called “customselect”, however, I’m wondering how could i add some extra “Input Options” in template variable settings (like Default Value):
I have seen that other default template variables have some different input options. Could somebody point to me to an example how to do it or give a bit more information about it?
Usually it’s best to look at other MODX extras, to see how to implement something:
For additional “Input Options” use the event OnTVInputPropertiesList.
For example the extra “Fred” adds a Yes/No combobox to the input options:
When you click the “Save” button in the manager to save the TV, the code makes an AJAX-request to the processor Element/Tv/Update (or Element/Tv/Create). The parameter “action” of the request defines the processor.
In the processor, the function “setInputProperties()” saves the values to the “input_properties” field:
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.