After an interaction, redirect the user to a URL based on the current URL

Hi, any of you guys know if it’s possible to have the user click an object and be redirected to a “dynamic URL” based on the current URL of the subpage?

Could be a different domain, could be the same domain with a different path.

I suppose this is not natively available in the designer, but is it possible with custom code?

Since I’m a layman, I imagine this being a solution to having a multilanguage site.
But having read a bunch of posts on the forum on this topic, I think it’s not that easy…

@Tomas_T - certainly possible with JavaScript, but would need to understand exactly what you are trying to accomplish.

1 Like

Thanks for chiming in @sam-g.

Let’s say a user is on a subpage www.domain.com/xyz.

I could have them click a button on the page and redirect them to a dynamic URL such that URL = www.domain.com/de/xyz

or

www.domain.de/xyz

Tell me if I should specify anything else. It’s highly likely I’m missing some other info and don’t even realize it.

@Tomas_T - what would you be using to determine which dynamic url to send them to? Something set by a cookie or something like that? Because otherwise you can just direct them based on which button they are clicking, like any link, but I’m assuming you are looking for something different than that.

1 Like

Well I guess I’d be using the button type (first option). Each button would be a language (German, French,…).
They click a language name (i.e. French) and it takes them to a URL that either ads /fr as a subdirectory to the current URL w/o a language subdirectory, or it exchanges another language subdirectory (like /de) for /fr subdirectory.
Or it simply exchanges the domain extension for .fr

@Tomas_T - I think you have a few options, and again I don’t totally have a clear picture of what your going for.

A lot of multi-lingual websites will give users the option to select their language and then set a cookie so that the site “remembers” their selection, of course the user can update that at any point by selecting a new language and resetting that cookie to a degree.

Once you’ve determined the language, most sites redirect users to that language specific version of the site, all buttons and links refer to the same variant of the site in that specific language, so there is no need to dynamically update urls on each link or button click.

Does that make sense? Am I following what you are trying to do?

1 Like

I understand the cookie idea, it’s interesting and useful. Good for the user when he/she returns to the site.
But maybe it’s a separate thing to my original issue.

I understand that once the language is determined, the dynamic URL generating doesn’t happen anymore. All URLs found on the new subpage have the same new structure. Only if the user wishes to change the language again would I need a dynamic URL generated again to change the URL based on what page the user was last on before changing the language.

Check out juniqe.com. They have this implemented for domain extensions. It’s basically what I want to reach with my site, but the subdirectory variation of this whole thing might be cool as well (less $$ for domains and site projects).

Any idea why this might not work / cause complications in Webflow?

And this page I found is doing it via subdirectories.

They also manage to do the same for currency display, but not via a subdirectory (obviously). Do you have any idea how they do it and whether it’s possible in Webflow?

PS: My webside is not an eshop, just a website displaying products in different currencies and units.