Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Trigger partial routing even when page exists

Vote:
 

The title isn't very clear sorry about that. :) Here's my problem:

I have a "List" page which has a drop down filled with the names of all the child pages. The child pages can be all sorts of different pages who all have their own templates, standard pages etc.

Assume the following structure

Releases

2014

2013

2012

 

When a user then selects an item in the drop down, specific data of that selected page is displayed on the "List" page. Easy enough.

However, I do not want to use a query string like page=2014 or something similar.
Instead what I want to do is /Releases/2014.

So, if I have a page which is a child of the "List" page, the "List" page should be rendered instead (as if the Release page was requested) instead of the requested child page and display the data of the requested child page, just as if a query string would've been used on the "List" page.

/Releases/2014
should produce the same result as
/Releases/?page=2014

I've tried to solve this using partial routing, but it won't trigger unless the page doesn't exist. Is there a way to "prioritize" my partial routing or am I going about this all wrong?

#82952
Mar 21, 2014 19:46
Vote:
 

We had about the same problem and we solved it with a combination of partial routing and section routing (see thread here)
http://world.episerver.com/Forum/Developer-forum/EPiServer-7-CMS/Thread-Container/2013/12/Best-way-to-do-custom-routing-and-still-be-able-to-used-the-editbutton/

I am about to write a blogpost on how to do it, but the key thing is that section-routing is handled first and partial after.

#83029
Mar 25, 2014 8:14
Vote:
 

Oh great Henrik, keep me updated! :)

Just curious, what exactly do you mean when you say "section routing"?

#83141
Edited, Mar 26, 2014 13:51
Vote:
 

I mean a lite type error :)
The thing I mean is segment routing.

I will get back with a post soon but for now read this post by Joel and you might get there before I am finish
http://joelabrahamsson.com/custom-routing-for-episerver-content/

#83144
Mar 26, 2014 13:59
Vote:
 

Thought so, just wanted to make sure!

Thank you! :)

#83145
Mar 26, 2014 14:00
* 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.