bolt / boltforms

Bolt 3 Forms extension - Symfony interface and API for Bolt
http://bolt.cm
GNU General Public License v3.0
52 stars 57 forks source link

Suggestion: make boltforms contain a boltform selector field #299

Open Puddingboy opened 4 years ago

Puddingboy commented 4 years ago

I think it would be a really convenient addition to have. A selectbox specifically to attach a boltform to a record. Yes it's already possible from the twig templates to attach, but this creates the inconvenience of stacking templates. The custom form templates does not always solve this issue.

Please take this into consideration. I think it would be nice to have.

How ideally this would be implemented: when you install boltforms, you attain a new option for a fieldtype you can add to the bolt fields which could be called type: boltformselect. On the record interface in your cms, it should show a simple selectfield default populated with the saved forms from the boltforms.yml, the default selected form should be empty ofcourse to avoid adding forms to records by accident.

Puddingboy commented 3 years ago

I want to reiterate on this suggestion. Rather than implementing a new field type. All extensions for bolt should be able to expose arrays to the select field. You could make it look like:

   type: select
   options:
      values: _extentionname_privatearrayname

This approach should reduce future clutter of custom extension field types a little

No custom field types. Simply an option to expose arrays to the select field.

I-Valchev commented 3 years ago

hi @Puddingboy , you can achieve this already with a normal select, right? Create a select with values for all forms and then use the boltform() function with the value from the select, like so: {{ boltform(record.selectedform) }}