Supporting <select>
options rendering + more
#4
Replies: 7 comments 16 replies
-
"Adding a new Target option in the Render list action" Sounds great! This would be a new optional setting field, so it does not hamper the current way of doing. Besides, I'm sure we would be able to explore other use cases of it as we move forward and as the wized tool gets picked up quite frequently by us on projects. |
Beta Was this translation helpful? Give feedback.
-
Agreed that the second method is the best. It's 100% flexible, just like the rest of the Wized features, and yet it wouldn't take a lot of user training to understand it and start using it. I'm assuming that this means that you would drop a Webflow native select element into the form and just not worry about the options in Designer as you'll be overriding them, yep? Maybe keeping a default option in there would be useful e.g. "Select one..." which defaults to "none selected" as is often the case with select fields. Once the feature is available I'm sure people will dream up ways to use it to render other types of child elements! |
Beta Was this translation helpful? Give feedback.
-
We just realized that the Target approach has one big flaw: we can't add other Actions to the target element, because it will still not have a wized Attribute. This means that you could render the elements, but not add any other functionality to them like setting text or styles. I'll keep thinking about this, but for now the recommended approach should be using the HTML Embed solution. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to add dropdown menus to each item of an array, but on the front-end it only seems to work on the first array item. Is this possible? Or is there a workaround? Thanks @alexiglesias93 |
Beta Was this translation helpful? Give feedback.
-
Hi all. I was trying to use the first method, I can render one option, but how do i render the list in the HTML select? Thank you |
Beta Was this translation helpful? Give feedback.
-
Hey, Alex! Currently I'm working on the project and there I have multi - select fields, that I rendered with this embed method. And I want to send selected options back to the database after the user submits the form. I'm using Select2 library on this project to style the fields. And I have some issues. When I try to send data to Wized from this select field it shows me an empty string when I'm using select field, styled with Select2 and when I use default Webflow multi - select it only outputs the first value from the list. Here's I've described problem in more details with screenshots: https://discord.com/channels/853733628931604480/1170663497596665906/1170663497596665906 Maybe you could help me to find a solution? Or maybe there's another method how can I get array data from user. Using checkboxes, for example. Will be grateful for any information) |
Beta Was this translation helpful? Give feedback.
-
Closing this discussion as it's no longer relevant since Webflow launched their Custom Elements. Users can simply create |
Beta Was this translation helpful? Give feedback.
-
Update: #4 (comment)
The problem
The render a list of element in Wized we offer the
Render list
action, that (surprise surprise) renders a list of elements based on the defined template element.For it to work we require adding a
wized
attribute to the template element, so Wized can identify it.The problem comes when trying to render a list of
<select>
options using Wized.Webflow has a built-in Select Field that's very convenient to use, but it has one major drawback: we can't target the child
<option>
elements. To dynamically render the select options with Wized, we need to define thewized
Attribute to an<option>
element that will act as the template.Potential solutions
I can think of three different solutions:
Target
option in theRender list
actionRender options list
actionUsing HTML Embeds as a workaround
Not much to say here, we would just educate users to create their
<select>
elements using an HTML Embed, this way they could add thewized
attribute to the<option>
element:This is the simplest solution, but the least convenient as users loose some of the benefits of Webflow's Designer.
Adding a new
Target
option in theRender list
actionWhen you select an element for the
Render list
action, that element is the one used as the template that will be replicated for each list item instance.I am thinking that we could add a new optional setting field called
Target
or similar, where users can explicitly define a child element to become the template.The target would be defined using a valid CSS selector (i.e.
option
,.my-class
,[fs-cmsfilter-field="value"]
, etc...).The benefit: Flexibility, as users could potentially not only use this for rendering
<select>
options but also for rendering anything.The downside: I can't think of any other use cases other than rendering
<option>
children.Still, this feels like the best option to me, but I'd love to hear from the community.
Creating a new
Render options list
actionInside the actions dropdown we would offer a new
Render options list
action. This list would exclusively apply to<select>
elements, and would allow users to populate the options with the same approach as the traditionalRender list
action, with the only difference that thewized
attribute would be applied to the<select>
element.I feel that this option could cause too much confusion + it is really not flexible at all.
Wrap up
I'd like to hear any other potential solutions that you come up with. All the proposed solutions in this RFC are valid, but none of them convince me 100%.
Beta Was this translation helpful? Give feedback.
All reactions