[UPDATED v2.2.0] šŸ˜ƒ Sudsy Page router for SEO-friendly clean URLs! (by Tech-Tonic)

No. Forget about the word ā€œexternalā€. Think only about the actual resulting URL - i.e. what you would see as the value of the hyperlinkā€™s (<a> tagā€™s) href attribute if you examined the page using the browser dev tools. If that URL points to the same page on which that URL resides, it wonā€™t work in IE.

For instance, if Iā€™m on the following Bubble pageā€¦

https://my-cool-app.bubbleapps.io/**users**

ā€¦where users is an actual Bubble page displaying a list of users, and I click the following link on one of the items in that list because I want to view detail about user Johnnyā€¦

https://my-cool-app.bubbleapps.io/**users**/johnny

ā€¦then nothing will happen in IE.

What will happen in supported browsers is that the page will be ā€œnotifiedā€ that the URL has changed, and that can be used in a conditional or workflow to, for instance, display an initially-hidden group with detail about ā€œJohnnyā€ - i.e. the list would disappear, and user details would be shown.

(As I said, though, no IE behavior is guaranteed moving forward, as IE is simply not supported. With regard to IE, Iā€™m just relating what Iā€™ve observed empirically with the current version of the plug-in.)

1 Like

Thanks for taking the time to explain it in detail. I will probably be making a purchase for the plugin soon as I want to enable a user to use the browsers back button to show a previously displayed group during an on-boarding flow.

Iā€™m also planning to use it for pages with tabs that hide/show different groups, in case a user presses the back button it doesnā€™t go to a different page, but just shows the previously displayed group.

I think it could also be utilized for a search results page. I use custom states for the filters to narrow down search results on business listings which are lost when a user navigates to a listings page, so if a user presses back button on browser the search filters are ā€œresetā€. In my mind I may be able to find a way to eliminate the need to have the listing page open in a new window to save the search filters.

Absolutely.

That should work no problem. Iā€™m doing it in an app Iā€™m developing. Aside from the friendly URL and SEO benefits, it also improves the mobile (i.e. low bandwidth) experience since data arenā€™t re-fetched during browser navigation.

Absolutely. Query string parameter support was added in v2 for just that reason. For instance, here are a couple deep links to the results for various search terms in the blog demoā€¦

Also, type any word into the search box and press return to see the results. Then, use the browser forward/back buttons to see that the page does not reload (server is not hit again).

Awesomeā€¦definitely seems like a must buy

Appreciate all the explanations

Hi @sudsy.

Any update on the Users Demo?

Currently Iā€™m working from social examples on the forums here, but seeing some issues with the back button that it seems your plugin might solve. Just wanted to make sure there arenā€™t any major hurdles to using Sudsy to navigate to user-created profiles. Thanks!

Thanks for pinging me about this, @nicedwar. The lack of a demo is due solely to my not yet having taken the time to create it - not to any technical ā€œhurdlesā€. (Been focused on other projects for the past 3 weeks or so.)

In fact, Iā€™m using it that way in my own Bubble app. That was one of the motivations for creating the plugin in the first place. I know thereā€™s at least one other Sudsy user making use of it that way as well.

That said, Iā€™ll try to get a demo up over the holidays. Plus, Iā€™ll post to this thread tomorrow with an outline describing the basic approach. :slightly_smiling_face:

1 Like

Hey @sudsy,

Thanks for a great plugin!

One question. I think I know the answer, but just wanted it to be ā€œdefiniteā€ :slight_smile: the IE incompatibility is caused by ā€˜coreā€™ functionality in the plugin, meaning that it will never work for IE, even in future updates?

For most projects thatā€™s not a huge thing, but for some, like eCommerce projects (where a big enough percentage of users still cling on to stoneage technologyā€¦) it may be worth thinking about.

Thanks very much for the feedback, @petter. I appreciate it!

As for IE, it simply lacks an underlying browser API being leveraged by the plug-in. I did identify a way to possibly make it work (effectively patching the missing functionality), but implementing it would be non-trivial.

So, unless plug-in sales justifies it or a prospective customer is interested in funding the development, it probably wonā€™t happen.

In short, it might be technically possible, but
there are no plans to pursue it, and it seems unlikely. With each passing year, IE becomes less and less relevant anyway. (Thank goodness!) :smirk:

As I was starting to do this, it occurred to me that the Quick Start portion of the Sudsy docs already steps through the process quite well. Be sure to carefully read the sub-sections:

The only thing I would emphasize in the context of a social sharing URL is that the onus of ensuring valid and unique usernames is entirely on you, the Bubble developer. In other words, when someone signs up on your site, youā€™ll need to make sure they choose a username that is not already in the database and which consists only of characters that are valid within a URL. That will ensure that the username can be used to retrieve user-specific data from the DB.

As for browser back-button functionality, that should work just fine while navigating your site if you either use hyperlinks or make sure that the Preserve history option is enabled when using workflows for navigation. (Using hyperlinks has SEO benefits, so that approach is generally preferred.)

If you have any other questions, let me know. :slightly_smiling_face:

3 Likes

@sudsy,

If Iā€™m not totally single-page with my app, what is the best way to keep Sudsy playing nice with data coming in across pages?

For example, if I have a blog posts/ page, I might click on a writerā€™s name to and navigate to a totally different page, like users/. My "Data to send" from the posts/ page is a specific user, and my users/ pageā€™s "Type of content" is User.
I then might have a text field that dynamically displays "Current Page User's email", or maybe all that users blog posts, which might navigate back to posts/ page.

Once Iā€™m on the users/ page, I get how I can search users, display their info, and modify the URL path, but it doesnā€™t look like Sudsy is able to modify the Current Page User? So once I come in this way, would the initial Current Page User be stuck while Sudsy is doing SPA stuff, displaying different user info over the top?

Or should I be coming in a different way, with a URL query and custom states?

Iā€™d like to avoid going totally SPA with lots of tabs and hidden content on one page, if possible.

Hi, @nicedwar. My app is not a SPA either. Like you, I created different ā€œsectionsā€ of the site - e.g. account, users, etc. - where each section is a Bubble page implementing multiple unique ā€œendpointsā€.

As you know, Sudsy works per-page. You can be selective about which pages use it. You neednā€™t add it to a page if youā€™d rather use Bubbleā€™s built-in mechanisms.

I donā€™t think that has anything to do with the Sudsy plugin. I believe Bubble simply treats pages with a defined Type of content in a special way. The data for such pages canā€™t be set by the Bubble developer; rather, Bubble attempts to handle it internally. (Technically, Sudsy doesnā€™t ā€œmodifyā€ anything anyway. It simply posts events and publishes states, enabling you to implement workflows based on that data.)

That said, following are a couple ways to deal with the scenario you describe. The first allows you to keep Bubbleā€™s ā€œdata-passing URLā€ on the referring page - i.e. the page with the link which passes the User object - whereas the second approach enables you to choose the URL youā€™d like to use to pass the user. I would recommend the second approach, as itā€™s just simpler since you have explicit control over the URL used to ā€œpass the User objectā€ to the target page.

  • 1st Approach: On the destination (User) page, instead of defining the Type of content for the page itself, create a ā€œPage Contentā€ group which contains all the page elements, and then set Type of content for that group to User, and then initialize that groupā€™s data like soā€¦


    Note that the condition on the event ensures the workflow runs only when the plugin is initialized, which (if the plug-in is at the page level) is basically on page load.

  • 2nd Approach: Design your own URL - perhaps utilizing a unique username (instead of Bubbleā€™s internal unique ID). So for instance, if you implement the following URLā€¦
     
    https://mydomain.com/users/johndoe
     
    ā€¦then the data on the target (User) page would be initialized in much the same way as above, except that the DB constraint might be something likeā€¦
     
    Username = This SudsyPage's Path Params:item #2

Does that make sense? If you have further questions, let me know.

(p.s. If you are working with the plug-in, Iā€™d prefer support requests be posted to the plugin help / support forum. Otherwise, this product announcement thread starts growing with content not directly related to the product announcement. Plus, itā€™s easier for others to find help if posts are topic-specific. Putting ā€œSudsyā€ somewhere in the subject line of your post will help bring it to my attention.)

2 Likes

Thank you!

Is it possible to have first level folders used to switch the language of the page ?

like app.co/en/page - app.co/fr/page ?

Thanks

Hi @philippe1, thatā€™s a great question. Let me preface my remarks by saying that I have not created a multilingual site myself, so Iā€™m not up to speed on best practices.

That said, what youā€™re asking is certainly possible, but Iā€™m not sure it would be the best way to proceed. Why? Well, the first ā€œfolder/levelā€ following the domain name MUST be an actual Bubble page, so youā€™d have to create a separate page for each language you plan to support, and that might or might not make sense for your app.

An alternative approach might be to have the language identifier be the 2nd URL parameter instead. So, considering a non-multilingual user profile page like the followingā€¦

ā€¦instead ofā€¦

ā€¦it might be something likeā€¦

In this example, ā€œusersā€ would be the actual Bubble page. The rest of the URL could then be used to determine what to show, including which language. So, the above would display Janeā€™s profile, and the following might display a contact form to message Janeā€¦

And the following could display a list of usersā€¦

That might not be desirable. I donā€™t know. Plus, you might have specific requirements and/or preferences for your URL structure, but I wanted to make sure you understood how things work.

So, in brief, what youā€™re asking is technically possible, but it means a separate Bubble page for each supported language would have to be maintained.

I donā€™t know if that helps, but if you have any other questions, let me know.

EDIT: BTW, a page in Bubble can have a single character name, so the following is a valid URL as wellā€¦

So, the URL structure is entirely up to you and limited only by the fact that the 1st URL parameter must be an actual Bubble page. So you should work out the desired URL structure first, and that might be guided, in part, by whether youā€™re creating a single page app (SPA) or not.

Hey Thank you !

This one was indeed out of the table as I have MANY pages.

So either I use a querystring (meh but ā€œnormalā€), either I use a very unorthodox path like

app.co/product/product-name/fr

Yeah, thatā€™s all that comes to mind. If something else occurs to me, Iā€™ll let you know.

Iā€™ve not delved very deeply into Google Translate, but might that or a similar service be an option? Seems like it might have the potential to make page maintenance easier.

For good SEO I need clear urls for the localised versions of each page

Sure, but I donā€™t know if that necessarily precludes the use of a translation service. Again, I have not experience with a multilingual site, but Iā€™m just thinking in terms of ease of maintaining the content.

I realise we didnt discuss subdomains, but I guess there wont be a great solution there either. Iā€™ll probably go with querystrings until something better is availableā€¦

1 Like

Hey Shot

I Have been considering using the power of sudsy page plugin but thinking of how to keep the IE users includedā€¦
I have my app configured to navigate within the page based on custom states that show/hide elements.
So, if I keep these workflows and implement the sudsy page URLs navigation, would that be a possible strategy to let IE users still have a functioning app?
I am guessing the sudsy actions wont work but the states will be doing the job in this case.

Am I wright?

@sudsy :point_up_2:t2: