November Happy Hour will be moved to Thursday December 5th.

How to route a virtual page to a correct view

Vote:
 

Hey Guys,

here is the case:

We have a json feed from an external system. So in EPiServer we have a overview page of the items. That's going ok, we create a contenttype for the overviewpage and consume the feed and render all the items on the page. Now all items will have a detail page. Now the feed can give us the detail info for such an item by ID. So in EPiServer i dont have a node in the tree for the detail page, so these pages will be virtual pages.

So i decided that on the overview page, i'll construct the urls to the detail pages for example /-ip123456/    .. So i mean the name of the page followed by "-ip" and the unique id to get the page from the feed.

Now in webconfig i thought of constructing a rewrite rule to handle this like this:


            
        
          
          
               
       
    

Now i'm coming from an Umbraco experience and in the action i would write /inpublic/?ipid={2} , meaning that the razor template to search for would be called "inpublic". Because in umbraco this is how the templating pipeline works, this would give me the correct template.

Now back to EPiServer 8. How would i set this up to let it redirect me to the correct view so i can pick up the "ipid" and get the details from the feed and render it in the template.

I'm a bit new to EPiServer 8 but i would imagine that there is a easy elegant way to do such a thing right?

#121805
May 18, 2015 8:29
Vote:
 

To me this sounds like something that could be handled by a partial router. You can find more information about that here:

http://joelabrahamsson.com/custom-routing-for-episerver-content/

http://world.episerver.com/blogs/Johan-Bjornfot/Dates1/2012/11/Partial-Routing/

#121973
May 22, 2015 13:46
* 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.