Is there any way to find the current route of user?
for example if user is watching homepage it return something like homepage.
or if user is watching a category with id of 52 (just an example) it returns category 52 or something similar to this to distinguish where the user is.
(I want this for creating a very dynamic widget and it should provide different menu on each page)
(and I don’t want to use window.location.href because url differ from each site to another and I want to create a widget for all discourse sites)
thank you so much but this have some problem.
for example when I open http://localhost:3000/c/foodwaste/information It showed discovery.category and it didn’t give any information about category
The current route is discovery.category, and the category is known as a dynamic segment. If you need to know information about the category, you can get it from the controller: