Constrained color select in form component #275
-
Hi SQLPagers, It seems SQLPage allows a So I’m trying to make a custom component (based on the existing form component) with the color selection input. For brevity, I’m illustrating my attempt to add just one color option: So I select that custom component: select 'form-color' as component,
'POST' as method;
select
'name' as name,
'Name' as label;
select
'description' as name,
'Description' as label,
'textarea' as type;
select
‘color’ as type;
and then I get a handlebars syntax error:
I know the component name is spelled correctly, and when I take away the added color input lines, the component works like a normal form component. Anyone see any issues? I’m sort of new to handlebars, so I think I’m doing something wrong here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Can you post your full component here? We should be able to help you find the syntax error in it. Maybe your if and /if do not match ? |
Beta Was this translation helpful? Give feedback.
json functions (including json_array) in SQLite return strings, not native json objects... To create an array, you can select multiple columns with the same name:
if you want to use json_array, you can parse the json from your template using the
to_array
helper. Here is an example from the shell component:https://github.com/lovasoa/SQLpage/blob/main/sqlpage/templates/shell.handlebars#L22-L26