You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DX] Form API: Allow specifying alternative configuration settings for elements using system_settings_form(), without having to use custom submit handler
#4102
Open
klonos opened this issue
Sep 28, 2019
· 3 comments
In https://api.backdropcms.org/api/backdrop/1/search/system_settings_form it mentions how you can specify a different config file for some of the form elements/values via '#config'. What do you do though if you want to save to the same top-level '#config', but to a different setting?
So say that your form element is $form['my']['cool']['element'] = array( ... ); but you want the setting to be saved as my_cool_element in the .json? ...is a custom submit handler the only option in that case?
...so both settings will be saved in the same mymodule.settings.json file. The first one as "first_setting", while the second one as "call_this_something_else". So instead of this:
...is a custom submit handler the only option in that case?
AFAIK, yes.
klonos
changed the title
[DX] How to specify alternative configuration settings for elements using system_settings_form()?
[DX] Form API: Allow specifying alternative configuration settings for elements using system_settings_form(), without having to use custom submit handler
Dec 26, 2022
In https://api.backdropcms.org/api/backdrop/1/search/system_settings_form it mentions how you can specify a different config file for some of the form elements/values via
'#config'
. What do you do though if you want to save to the same top-level'#config'
, but to a different setting?So say that your form element is
$form['my']['cool']['element'] = array( ... );
but you want the setting to be saved asmy_cool_element
in the .json? ...is a custom submit handler the only option in that case?So basically, I understand that you can do this:
...and that this saves
first_setting
inmymodule.settings.json
, whilesecond_setting
is saved inmymodule.moar.settings.json
.What I need to do though is something like this:
...so both settings will be saved in the same
mymodule.settings.json
file. The first one as"first_setting"
, while the second one as"call_this_something_else"
. So instead of this:...I would instead want to have this:
The text was updated successfully, but these errors were encountered: