cot_inputbox resetting custom html code for extrafield
Eugene |
|
---|---|
When updating/customizing extrafield html code in admin area - it goes to DB (cot_extra_fields) as "field_html". <input required="required" type="text" name="{$name}" value="{$value}" {$attrs} /> or <input type="number" name="{$name}" value="{$value}" {$attrs} />
|
Trustmaster |
|
---|---|
Any ideas on how to set priorities between these 2? May the Source be with you!
|
Eugene |
|
---|---|
2 option is higher priority for the sake of clarity in administration/tuning...
As i understand we cannot change last argument of function cot_inputbox (and selectbox) for backward compatibility. Right? I'm sure, there's another option of checking things right in cot_inputbox.... Добавлено 2 дня спустя: Trust, do you want me to add this to GitHub? |
|
Відредаговано: Eugene (13.03.2013 21:15, 11 років тому) |
Trustmaster |
|
---|---|
Priorities are actually fine. It's a small bug in cot_inputbox() function which doesn't let you set custom_rc. I'll fix it shortly. May the Source be with you!
|
Eugene |
|
---|---|
it would be awesome! btw, i guess the same mechanism is in cot_selectbox... |
Trustmaster |
|
---|---|
For selectbox you can only use custom HTML for the select itself but not options. May the Source be with you!
|
Eugene |
|
---|---|
Yes, and let me clarify a problem, cause you can advise a solution. As you know there's no placeholder for select. And there several ways to emulate it. Simple html-way is to include empty-value-option into select before all other selects. So, there's line for custom select in RC: $R['input_select_rpageoptik'] = '<select required name="{$name}"{$attrs}>'. '<option label="Jede Optik" value="" selected="selected" >Jede Optik</option>'. '{$options}</select>{$error}'; But in cot_selectbox selected is already build-in and always assign to one of assigned options. This way I will have 2 selected options. Also, as empty-value-option is not in array of assigned values I will get error (field_notinarray_..) from extrafield_import... You may say, "so, add empty value by $add_empty = true". But it is not possible, cause it also not custom in cot_build_extrafields. Moreover, there is no way to create custom $R['code_option_empty'] for some custom selectbox.... it is "---" (default) for all empty options in selects... |
Trustmaster |
|
---|---|
This is not a bug, this is how it is supposed to work. It is a new feature that you are missing: custom empty options and default options for selects. It should be implemented explicitly in cot_selectbox() function, or you could implement it as your own function. May the Source be with you!
|