ASPX templates
Version 5.x > ASPX templates > URL Rewriting with Custom Tables View modes: 
User avatar
Member
Member
dave-australianinfront.com - 5/18/2010 7:37:25 AM
   
URL Rewriting with Custom Tables
Hi,

I'm currently building my first site with Kentico. I want to know if it's possible to use URL rewriting to pull out individual records from a custom table. For example, I have a news table with the following structure

ID
Name
Date
Abstract
Copy
etc

I would like to create a URL that maps to that record e.g.
/news/{year}/{month}/{title} which becomes
/news/2010/05/this-is-the-news-item-title.aspx

which would then map to, for example
/CMSTemplates/MySite/News.aspx?recordID=XXXX

Is this possible?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 5/18/2010 8:10:44 AM
   
RE:URL Rewriting with Custom Tables
Hi,


You could handle custom URL re-writing in Global.asax.cs file (in App_Code folder). However, I would recommend you using URL wildcards. Please see the documentation.

You can access the values of wildcards as query string macros so you can use them in the Where condition of listing web parts on your page. You can use Custom table repeater, Custom table datagrid or Custom table datalist and use its Where condition. Optionally, you can use a custom table data source and Basic repeater/datalist. Please see the documentation.


Best regards,
Helena Grulichova

User avatar
Member
Member
dave-australianinfront.com - 5/18/2010 8:13:52 AM
   
RE:URL Rewriting with Custom Tables
Thanks for the quick reply, Helena - will look into it!