<option>
elements using CMS data.To create a dropdown menu that filters neighborhoods from a CMS Collection in Webflow and redirects to the corresponding page after selection, follow these steps:
/neighborhoods/chelsea
).Webflow does not natively bind CMS content to a Form Dropdown, so use a workaround:
<script>
tag needed):document.querySelector('.Neighborhood-Dropdown select').innerHTML += '<option value="/neighborhoods/{{slug}}">{{name}}</option>';
{{slug}}
and {{name}}
with the CMS fields using Webflow’s +Add Field menu (e.g., Slug
, Name
).With the dropdown selected, go to the Settings panel.
Add a unique ID like neighborhood-select
.
Then, embed custom code to redirect users after selection:
In the Page Settings → Before
tag, insert:
`document.getElementById('neighborhood-select').addEventListener('change', function(e) {
if (e.target.value) {
window.location.href = e.target.value;
}
});`
<option value="">Select a neighborhood...</option>
Build a dynamic dropdown using a manual embed workaround to inject CMS items as <option>
elements. Each option links to the neighborhood's CMS page, and selecting an item triggers a client-side redirect based on the selected value.