Passing Unique ID in URL - Another Way

Okay - I figured out to get pass a unique id in the url from one page to another and then display other related fields on the page based on the unique id. Is there another way to do this that doesn’t require putting the unique id number value in the URL path? Maybe like a temporary global parameter?

You could use a slug instead, which you can define as anything you want, but you would need to make sure your slugs were unique. Slugs also allow you to use natural language instead of the random letters/numbers of a unique ID.

For example, if you are working with a list of clothing, instead of www.example.com/clothing/182489273583x8934892734983, you could have www.example.com/clothing/red-shirt/ .

1 Like

Another way would be to rely on local storage sessions but that would be a typical case of over- engineering

To make it look better just set a slug

Thanks. Will try it out.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.