Try our conversational search powered by Generative AI!

Modify "Shortcut type - Shortcut to other content item"

Vote:
 

Hi,

Has anyone succeeded or tried catching the "Shortcut type - Shortcut to other content item" event and modify where the redirect is going. Say that the shurtcut is set to Page A in EPi but I want to catch the redirect when its happening and redirect to page B instead. I tried "ContentRoute/RoutingContent/RoutedContent" without any success. Is this even possible to do? 

Thanks!

#195641
Aug 02, 2018 15:33
Vote:
 

Hi Henrik,

Try to identify which route is doing magic in System.Web.Routing.RouteTable.Routes, use some decompiler to find it in Episerver dlls, and replace it on init with your own implementation.

Let us know how it went, even supply some code here.

#195758
Aug 07, 2018 12:32
Vote:
 

Hi GOSSO

Thanks for youre answer. I been looking in to this(better late then never) to see whats going on and there are some things in the EPi-Server MVC pipeline that I cant figure out. 

When the request reaches the IRouteHandler and the GetRoutedData method is called the requestContext already contains the shurtcut reference and not the orginal reference ID. The requestContext.GetOriginalRoutedLink() in the GetRoutedData method is supposed to give me the "ordinary" routed reference if it is a a partial router or a page with shortcut but it is always null. The IViewContentRetriever method GetPage has logic for handling shortcut but the requestContext is ofcourse wrong since that happens after the IRouteHandler has done its magic. There must be something happening before the IRouteHandler that changes the requestContext and loads the correct IRouteHandler from the RouteTable but I cant see where this is happening and how to do a custom implementation.

Maybe someone with insight in the EPi Mvc pipeline can give me some pointers and tell me what I am missing. :)

/ Henrik   

#197937
Oct 17, 2018 15:40
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.