kenticokentico-12kentico-mvckentico-api

CMS_DocumentAlias table is empty Kentico


I am trying some different basic URL mapping methods for Kentico 12 MVC and I have seen this post: https://devnet.kentico.com/questions/get-treenode-by-url

SelectSingleNode is returning null. When I check my database, the CMS_DocumentAlias table is empty. Is there another table that holds page data with NodeAliasPath?

Once I have found the page I want to map it to the appropriate controller by basing my controller names from the Page Type's code name.

I am relatively new to Kentico and am coming from Sitecore so URL mapping is turning out to be tricky outside of hard coding all routes in the RouteConfig.

I have tried out DevTrev's solution but to no success. From a newbie's perspective, the article and set up instructions are not clear enough. http://www.devtrev.com/Trev-Tips-(Blog)/June-2019/Dynamic-Routing-with-Kentico-MVC-Service-Pack


Solution

  • Sorry my article was not as easy to follow. The CMS_DocumentAlias is no longer used in the MVC realm, in Service Pack they created a new alternative urls table but it still is not what you are looking for.

    We're working on rebuilding an even better Dynamic routing, one that uses Attribute or Assembly tags to map Page Types to Controllers, but it may be a month or so.

    Until then, if you want to send me a message on my devtrev.com site, i'll get in touch with you and see if i can help you through it.

    You can also use my Kentico Boilerplate which has the version of Dynamic Routing already baked in and does what you describe (find page on NodeAliasPath, and direct to controller that matches the Page Type's class name).