How to change a URL query parameter without reloading the page

There is no such thing as a dumb question. Only dummies don’t ask questions. :smirk:

 

You should shift your thinking away from “pages” toward “URLs”. My plugin works only within the context of the current page and only with URLs. To achieve what you’d want, you’d simply “navigate” to the desired URL - i.e. one without the QS param. That can be done using a hyperlink OR via a workflow action. The page won’t reload; the URL simply updates and Sudsy notifies your app of such.

So yes, you can achieve what you want - just not exactly how you might have thought. You’d simply use the dynamic expression builder to specify the destination URL / route.

 

That’s exactly right. Bubble assumes that the first path parameter following the domain is an actual Bubble page. If it’s not, you get a 404. That’s just how Bubble works whether or not the plug-in is installed.

 

That’s how some users are doing it. I’m probably not in a position to make a recommendation, as the best approach depends on your app and your desired UX. I’d probably use the index page as a landing page and have the app reside at https://mysite.com/app.

The way I use Sudsy most of the time, though, is not for SPA, but rather as a way to “segment” my application for organizational and SEO purposes. It also makes the app easier to maintain IMO.

For instance, an app I’m currently building has an eateries page, but that one page has the following “routes” (among others):

  • https://mysite.com/eateries
    List of restaurants.

  • https://mysite.com/eateries?search=jojo
    Popup to search for a specific eatery.

  • https://mysite.com/eateries/jojos-cafe
    Detail view for individual restaurant.

  • https://mysite.com/eateries/jojos-cafe/location
    Popup with map and directions to individual restaurant.

Similarly, there’s a single Bubble account page with different “routes” for managing one’s profile, viewing orders, managing payment methods, etc.

For working with query string parameters, Sudsy publishes a list of custom objects - each having a “Name” and “Value” attribute. So, to get the value of a specific qs param, you’d filter the list with a constraint where Name = the_name and get :first item's Value. To check if a particular qs param is present would be a similar approach but check if :first item is empty. IOW, you would not use Bubble’s built-in mechanism for getting / setting query string parameters. Rather, standard list filtering techniques would be used instead.

Hope that helps somewhat. If you have any other questions, let me know.

-Steve

1 Like