rainlab/builder-plugin

Builder Form - change between form configuration files

AdrianoRamalho21 opened this issue · 1 comments

Hey guys,

Here's the deal, I have a Model called "Pages", and I wanna have multiple and distinct forms PER Page, I wanna have the homepage.yaml form config file for the Homepage page, I wanna have the about.yaml form config file for the About page, for example...

The default form file is "fields.yaml", and I wanna show a list of all those .yaml files so the user can select which file (form layout) he wants to use/fill through the backend.

I know you can change the form .yaml file in the config_form.yaml on your controllers folder, but I was wondering if there is a way to change it through a dropdown list on the backend...

Thank you in advance,

Adriano Ramalho

This isn't really a question specific to the builder plugin, more so just about extending October in general. The easiest way of doing this would be to implement custom model fields.yaml files per context in the config_form.yaml, and then implement actions to handle those contexts and just link to those actions.

Another way you could handle it is by having a dropdown in your list toolbar on your index page, and then store the selected value in the session or user preferences and use that in the constructor to dynamically choose which config_form.yaml to load