The following example shows MVC development with Kentico CMS.
This document has two MVC Routes registered as document aliases:
/NewsMVC/List - The final route is /NewsMVC/List with default controller set to NewsMVC and default action set to List
/NewsMVC/Detail/{id} - The final route is /NewsMVC/Detail/{id} with default controller set to NewsMVC and default action set to Detail
Click here to see the example output
There are also other options available with MVC patterns:
{controller}, {action} - Enables to provide the controller and action dynamically from the URL, e.g. /{controller}/{action}/{id} provides the same output at /NewsMVC/Detail/Community-Website-Section, but with more options to direct the user to particular items (URL parts may vary).
{name;value} - Provides default value for generating URLs from URL path. E.g. /{controller;NewsMVC}/{action;Detail}/{id;Community-Website-Section} provides the same functionality and pattern as previous option, but the system is able to generate the default URL of the document /NewsMVC/Detail/Community-Website-Section automatically.
{*name;value*} - Hidden value, which is registered as a value in the processing, but isn't incorporated into the URL itself. E.g. /NewsMVC/List{*TopN;10*} generates pattern /NewsMVC/List and provides the value of TopN during the processing of the request. Note that the TOP N functionality is not implemented in the sample controller and you need to handle it if you want to try it. The URL of the page will be still the same as before (the parameter is hidden) This way, the pages can be parametrized by the developer even if they use the same controller and action.