We recommend using our API method for internal page linking, so that problems like broken links can be monitored by system. In some cases you will be able to use the advanced Dynamic linking feature of Kooboo.
Instead of using "<a href="/pagename/contentid" >link text</a>", please use <%= Html.PageLink ( item["Title"].ToString(), "pagename",new {ContentId= item["ContentId"]}) %>.
Html.PageLink method: First parameter item["Title"].ToString() is the link text, second parameter "pagename" is Kooboo page name, the third parameter "new {ContentId= item["ContentId"]}" will be appended as query string to the destination page.
Links generated by PageLink method may contain querystring if there is any. In the destination page, you can define URL rule to rewrite querystring into static page like URL. See below screen.
You can customize your URL, above {ContentId} should be match to the parameters in PageLink method, in above example the "new {ContentId= item["ContentId"]}" parameter in PageLink method.
Before this customization, your URL might look like /site/page?ContentId=123. After URL customization, your URL can look like site/page/123. This customization can help search engines find your web pages easier. You can also define DefaultParam which will assign a value to the URL.
Besides static URL, some people like to have some keywords in the URL. One implementation is to use the "UserKey" of Text Schema, you can input anything unique as an UserKey and pass UserKey value as a key in the URL static query string.
Page URL generation API
Page URL API is an extension to ASP.NET MVC HtmlHelper, defined in Everest.CmsServices.MvcHelper.UrlHelperExtensions as below.
public static string PageUrl(this UrlHelper urlHelper, string pageName) public static string PageUrl(this UrlHelper urlHelper, string pageName, object values)
Example code are Url.PageUrl("PageName",new {ContentId = 100}). More parameters can be inserted.
Url.PageUrl only generates a pure URL address string. To generate a html link with <a href> tag, you can use Html.PageLink method.
