Hiding URL variable of a dynamically created page

Hello Weweb Community!

I’m looking to hide a URL variable that appears when I created page dynamically using this method while still passing the variable because I need it.

https://www.buongiorno.com/jonedoe/azumaya-beach-house/1039

to

https://www.buongiorno.com/jonedoe/azumaya-beach-house/

Is it something possible?

Thank you !

Hello @lighthama :wave:

May I ask why doing this?

This go against web best practices, as user won’t be able to navigate between pages and it’s bad for SEO, as all your pages will count as duplicates.

The problem is the user does not know the ID and hence it is useless from a frontend perspective.

We can’t rely on neither potential clients or our team needing to enter the ID to revisit the same page. It has to be the page name that is the reference, both for navigating the website and for SEO purposes.

Please help us find a solution because this is causing a delay in launching the website.

Thank you.
Rhodri

Instead of the ID, you could use a slug that is more human-readable.

If you want to go your way, you could use a variable which is stored in localstorage, and use it to store the current record ID, then filter your collection on page load. But then, your page would appear empty to any user that would directly land on it, except if your variable has a default value.

I would still suggest against doing this, as I don’t know any website or webapp doing this, and this is really bad for user experience :wink:

1 Like

@Quentin Thanks for your response.

Not sure we have a way… still trying to figure out the best solution. Page loading without content certainly isn’t what we want.

The API endpoint we are using includes a readable slug. But if we don’t include the ID afterwards, WeWeb does not filter the content accordingly. The same thing goes for the page titles, again using the same endpoint which is designed for SEO, WeWeb is returning a long string in jibberish (see screenshot).

Perhaps we are simply doing something wrong… It’s unclear to me because all the logic seems to be there, just the final execution is the problem.

Screenshot 2023-05-05 at 16.26.43

Is the collection coming from an API?

Hello @Quentin, yes it is :slight_smile: