I am using Sitecore 7.5 and Sitecore 8 (2 separate projects with the same need). We have content items stored in buckets, but they are not page items themselves (they have no presentation bound to them, they are data items only and might come from varying sources including item buckets).
So here's a general layout of the problem: The page we want to render items with would be something like /sitecore/content/home/news We need to be able to parse the pathinfo after the item name as the data payload for the controller rendering.
So, what I've tried so far includes creating a custom route along these lines:
routes.MapRoute(
"Blog",
"blog/{*pathInfo}",
new
{
scItemPath = "/sitecore/content/Home/Blog",
controller = "Blog",
action = "DefaultAction"
});
I load the routes from the RenderCustomRoutes pipeline, and I have configured this to be called from before and after the Sitecore InitializeRoutes pipeline in different testing attempts.
I referenced this from http://www.sitecore.net/learn/blogs/technical-blogs/john-west-sitecore-blog/posts/2012/10/using-sitecore-keys-in-mvc-routes-with-the-sitecore-aspnet-cms.aspx and some related articles.
Following a number of additional articles from there where he revises his instructions or goes on to address other problems doesn't solve my scenario. The thing is, none of this works. In this case the controller is called correctly, but while I get the item itself in the rendering context I do not get any of the rest of the page's renderings. Is there a way to launch the rendering pipeline from here, or to assemble the page using the rest of the presentation details of the blog item and do it manually?
The other route I've tried was just trying to pass the pathinfo as data to the existing blog page url, but I end up with a 404.
I don't know if I'm chasing a wild goose here and that there's a better way or if I'm just missing a piece somewhere. In Webforms I'd probably have done url rewriting to achieve this without using querystrings but I was hoping that the routes would be designed to handle things just like this and the articles I was seeing seemed to lead me to think it is possible.
Additional things I've been considering: John West says that there are 4 ways for Sitecore to handle an MVC request
1.Ignore the Request: Allow ASP.NET MVC to handle it as if Sitecore was not installed, without establishing a Sitecore context.
2.Apply a Route: Use the controller and action specified by an MVC route.
3.Apply the Designated Action: Use the controller and action specified in the context item.
4.Apply a View: Use Sitecore’s default controller and action to invoke the view defined in layout details for the context device in the context item.
What I get when I use the custom route seems to fit #2, but what I need is something more like #3 or #4 while still using the custom route.