I would like to know if there is a developer on this forum that has ever implemented or developed a system where the following scenario is described in the documentation:
Custom Custom Field Types:
-----------------------------------------
Movabletype Documentation here:
http://www.movabletype.org/documentation/developer/custom-custom-field-types.html
Sometimes the choices available are not adequate, and a developer would like to define a new form element or custom field type. For example, suppose you want to allow authors to select a different sidebar (or "widget set") from a pull down menu for each entry and/or page? Such an option doesn't exist by default.
The following example will show how to create a custom "Custom Field Type" that a user can use to associate with a page or entry. The custom field could then allow them to select from a pull down menu the widget set that they would like to have associated with the current entry or page.
-----------------------------------------
If would be very powerful if this is a standard implementation in MT.
Reported on Movable Type 5

Hi Avner,
For this very case of the widget set and the pull down menu, you could create a "Drop Down Menu" custom field for the object "Entry" and eventually the object "Page".
Then, you could check against the output of that custom field and include a different widget set for each specific value from the "drop down menu".
The idea is that you could combine custom fields with the template tags logic and create anything you need for your project.
Kind Regards,
Mihai Bocsaru
----------------------------------
Daily Movable Type Consultant
Web Development
Movable Type Consulting
Six Apart Partner
http://www.pro-it-service.com/
----------------------------------
Movable Type Demo
http://www.movabletypedemo.org/
Mihai, thanks for your quick response.
From what I understand you are saying, this can be done without creating an additional plugin, like the above MT documentation at the link suggests.
So what I need to do is create a custom field, and use the Widget Set names as options for the drop-down menu, and then add the following code somewhere in a template or module.
---------
<mt:If tag="page_sidebar" eq="Sidebar 1">
<$mt:WidgetSet name="Sidebar 1"$>
</mt:If>
<mt:If tag="page_sidebar" eq="Menu Only">
<$mt:WidgetSet name="Sidebar 2"$>
</mt:If>
---------
I have actually done this, so a user can select a new page's style like this, based on a predefined template. That works quite well.
This will probably also work then for sidebars, or anything else for that matter.
Let me know if I am not on the right track.
Thanks!
Yes, that is correct :)
You're welcome!
Hi Avner,
Mihai is correct, if you have a Movable Type Pro license which comes with the Custom Fields plugin. If you are on MTOS, the free distribution, then perhaps the best solution is my free "TemplateSelector" plugin.
https://github.com/Hiranyaloka/mt-plugin-template-selector
The TemplateSelector plugin allows you to define a preselected list of templates which can then be chosen from within an Entry or Page. The name of that template is then stored in the TemplateSelector tag, which you use in your templates in the context of an Entry or Page.
The TemplateSelector plugin also comes with a "WidgetSelector" and "WidgetSetSelector" tags, which work the same as the TemplateSelector tag. You choose individual widgets or widget sets from a pulldown menu in the edit Entry or Page panels
BTW, Template Selector is compatible with MT4 Pro also.
I have only tested the plugin on MT4, with the (currently) required ConfigAssistant plugin (which is not MT5 compatible).
https://github.com/openmelody/mt-plugin-configassistant
Eventually I'll either remove the ConfigAssistant dependency or test it with a CA fork that runs on MT5.
Mihai, thanks for the support, and Rick, good to know about your TemplateSelector plugin. It will be great to get this working on MT5. I run a few test installations, but also have some clients in MT Pro.
You're welcome!