Kooboo's link is based on ASP.NET MVC Routing engine. Every link contains a link text, a page name, or a page name with a path. The default page name is 'Index,' 'default,' or 'home.' Those values are defined in the web.config under 'appsettings.'
We recommend using our API method for internal page linking, so that problems like broken links can be monitored by the system.
In some cases you will be able to use the advanced Dynamic linking feature of Kooboo.
Html.PageLink
Instead of using "<a href="/pagename/contentid" >link text</a>", please use <%= Html.PageLink ( item["Title"].ToString(), cms_page.VirtualPath,new {ContentId= item["ContentId"]}) %>.
Html.PageLink method: First parameter item["Title"].ToString() is the link text, second parameter pagename is Kooboo page name with path on it, for example: "news/detail", 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 a 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 default value to the page.
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 a UserKey and pass UserKey value as a key in the URL.
Url.PageUrl
Page URL API is an extension to ASP.NET MVC HtmlHelper, defined in Everest.CmsServices.MvcHelper.UrlHelperExtensions as below.
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.
