Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Intercept Route to handle a deep link

Started by Robin Kählert 5 years ago · 0 replies · 352 views
5 years ago

Hi all,

i would like to create a javascriptless deeplink which should open a modal window rendered by grav.

I imagined using a route interceptor for that but yet i was not able to find the correct event hook for it. Basically this is what i imagined how it is handled:

  1. Request URL from grav e.g. https://mysite.de/page/deeplink-id
  2. Grav checks the URI path if it ends with deeplink-id
  3. If no, grav proceeds normally
  4. If yes, grav removes /deeplink-id from the requested URI (so that the page gets requested as deeplink-id does not exist) and provides a variable which is indicating if the URL included the deeplink to adapt the twig template

Is something like this possible? Is there a better way to do it?

Support is very appreciated, thanks a lot in advance!

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 10 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago