Try our conversational search powered by Generative AI!

Partial Router Configuration on the CMS 12( .net 5)

Vote:
 

Hi,

I am working on upgrade project, where I am upgrading it from .net  4.7 to 5 version. In the legacy project, we have custom partialRouters implementation(using IPartial Router) for catalog pages and product pages. 

In the upgrade project we are using CMS 12 version and I am trying to find out how i can make these partial routers work in this version.

Any thoughts on how to register these partial routers would be helpful?

Thanks,

Shahira

#274692
Feb 28, 2022 17:22
Vote:
 

Hi Shahira,

You no longer need to use the PartialRouteHandler extension method, instead you can register your partial router implementation as IPartialRouter in the DI container.

See the Example of News partial routing documentation.

#275069
Edited, Mar 01, 2022 13:33
Vote:
 

Shahira,

I found the News example confusing, since it also deals with external data (outside CMS). If you have a simple example of what you are migrating, post it here.

I used partial view in CMS 12 to handle excluding folders from URL.

  • CMS structure: /Blog/2022/10 Ways to Feel Better
  • URL: /blog/10-ways-to-feel-better

And it works great.using IPartialRouter<BlogListPage, BlogItemPage>. But no point is giving a big example if you are trying to do something else.

#276129
Mar 11, 2022 16:49
* 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.