Change a dynamic text element based on page url (without a Dynamic Page)

Hi everyone,

I’m new to WixCode, but I have some experience in coding. I want to add dynamic text to my existing WixStore product page, based on the URL slug for each item. I.e. when the url contains /product1 I want to show the text in the same row of the dataset as the “/product1” slug. I have a dataset with all the slugs and the texts to be displayed.

How can I make a dynamic text element change based on the page url, without using a Dynamic Page?

(I would like to avoid having to create a custom product page in a Dynamic Page and redirect existing links, if possible.)