Read pathname as a Variable

Many uses for a functionality like that…

https://myglideapp.com/ menu.restaurant_1
https://myglideapp.com/ menu.restaurant_2

Any workarround?