I am updating URL parameters using javascript so that I can set dynamic url parameter keys vs static keys using “Go to page”. I have an expression that uses the parameter, but bubble doesn’t update it when the url changes. Below is a figma showing the setup and issue. Thoughts?
Hi @dave21,
Yeah, I know where you’re coming from. The odd thing is you can use a dynamic expression for the key when retrieving a value - just not when setting it.
And you’re right, Bubble won’t see URL changes triggered by your JS. You’re basically circumventing the Bubble “framework”, so it’s unaware of the URL changes.
You might want to check out…
Sudsy Page is for use in place of Bubble’s Go to page
action. (You shouldn’t mix nav approaches on a given page.) Query string parameters are exposed as a list of name/value pairs, and either can be dynamic because you actually construct your URLs using dynamic expressions.
Does Sudsy Page avoid triggering ‘Page load’ actions when navigating to the same page without refresh? Bubble does not hard-refresh the page but the page load workflows are triggered if the ‘go to page’ action is used on the same page.
That is one of the main reasons I don’t use native Bubble URL parameter navigation with SPAs. I use Custom State + optionsets which are set on page-load, and then i use window.history.pushState() to update the url and history as the states change. It works well, has all the pros of native bubble param navigation and the ones of custom state navigation, but it’s quite rough to maintain. And of course it doesn’t have all the other non-bubble benefits of Sudsy Page.
Yes indeed. Bubble’s page load event is not triggered on Sudsy Page URL changes. Not only that, but you can build logic based on how the URL was changed - i.e. via page load, workflow action, link click, or history nav.
Plus, as you suggest, there are other potential uses as well, such as the ability to make use of links appearing inside Bubble text elements (via BBCode) or inside HTML elements. IOW, the links can appear “in line” within the flow of the page content and don’t have to be “block” elements like Bubble’s built-in link element (although it works with those as well, by default).
For example, here’s a proof-of-concept “templating” system that I built for a client…
The data in the highlighted links on the right is being pulled from the DB, and Sudsy Page is used to trigger a workflow when the link is clicked so that the DB data can be updated. (That example is still on the old layout engine as well as on a free plan, so if the DB row quota is exceeded, the data can’t be changed.) Anyway, hopefully you get the idea.
This topic was automatically closed after 70 days. New replies are no longer allowed.