Dropdown menu to change embedded iframe link

I’m not sure if it’s possible but I’m trying to add a dropdown menu to change store locations. But what I want to happen is when you select the location it changes the embedded html link in the container and display a different link inside the iframe

Thanks!


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hi Kyle,

It’s difficult to guess what you mean by “embedded HTML link”.
But here are some approaches in general;

CHANGING THE LINK

If you’re wanting to change the contents of an IFRAME, you can write a piece of JS to change the src of the IFRAME, and it will load new content.

If you’re wanting to simply change a link, that same JS can change the link of your button in the same way, by setting the src.

If you’re trying to do something more creative like changing a pane of content, I’d actually do this differently. I’d probably build the content as a tab component, one tab for each store. Then hide the tabs. Your custom code would then listing for a dropdown change, and then “click” the appropriate tab to display the desired content. This is just a nice approach because the designer will let you “collapse” that content neatly out of view in the tab panes.

STORING THE LINK

If your dropdown is built from CMS content ( check out the Custom element for building the options ), you can store the URL you want in the CMS and bind it to a custom attribute. That makes it more easily accessible for your script.

Or, if there are only a few items that rarely change, you can just store that URL in the script as literals.

Thanks for the Info, If you look at the included read link, the iframe on the left side of the screen I would like to change the contents of that iframe using a dropdown.

Hopefully that is a bit more helpful

https://preview.webflow.com/preview/definitivemotorwerk?utm_medium=preview_link&utm_source=designer&utm_content=definitivemotorwerk&preview=93d41b120b86f4cba812f5b841f66878&pageId=64ffb71f8fcd84c1339ad81f&workflow=preview

Yep then you can use my first approach, or you might be able to make direct targeting work for you.