Page (v. 1.2, 2.0)

A page on Kooboo is no longer a physical file. Kooboo is built based on ASP.NET MVC framework, which, unlike traditional ASP.NET, does not map a URL to a file. With Kooboo, a URL or Page contains only configuration values. A page defines which template and content to use. Kooboo produces the final page based on the configuration values. The main tasks of page includes loading template, querying data, page link generation, and extension execution.

Add path: Application --> Page, click "New" button to create a new page.
kooboo add a new page
This will open the page editing window, clicking the "advanced" tab will open more options.
Kooboo page editing screen
Kooboo produces final page out based on defined configuration values. The screen below is a rough idea of how a page is produced.
Kooboo paeg explaination

Layout template


The layout to use. Layout template contains position tag and HTML code.

URL


For a more SEO-friendly way, you may customize the URL to anyway you like. You can use content title, userkey, content ID, or other fields in the URL, you are able to add many, but not all, characters in the URL.

In the typical list & detail page situation, the query string parameters that the detail page will have is determined by what is sent from the list page. On the list page, you may have a code like below.
 Html.PageLink(item["Title"].ToString(),"detail",new {ContentId= item["ContentId"], Title=cleanTitle(item["Title"].ToString())}) 

This will pass the Content ID and Title as query string parameters to the detail page. So the URL becomes:
 http://kooboosite.com/c-demo/detail/?ContentId=2747&Title=mytitle

If you customize them to {ContentId}_{Title}_anythingelse, so the URL will become:
 http://kooboosite.com/c-demo/detail/2747_mytitle_anythingelse
 


IMPORTANT NOTE: It is very important to remember that in order to have SEO friendly Module URL, the correct URL value should be: {*ModuleUrl} instead of {ModuleUrl}, note the * here. This * is only needed on Module URL

DefaultParam: Default Parameter values

Navigation


Pages can be used on menu/navigation. There are API methods to query navigation tree.
Nav Parent:The parent page on navigation tree
Show In Menu: Appear on navigation tree or not
Navigation Text: Link Text
Navigation Order: Sort order on display

For more information about Navigation, please refer to the document about menu.

Data Rule


Data rule is Kooboo's way for data access which binds real business data (from content) to templates. Data rule can be defined on pages or content templates. There are some information about DataRule in the "quick start" or "DataRule" documents. Below are some basic concepts of Data Rule.

DataName: Returned object name of this data rule. If we defined the name as "Content" with a object return type, in the content template, we need to use this.GetContent("Content") to access the data.
ValueType: The type of object to return. For example, List means a collection of objects, object means one object.
Folder: The folder which contains the content to be retrieved.
Value Condition: The WHERE condition in standard SQL statement. You can use the value from querystring as well. In the "Advanced" tab, there is a possibility to customize your URL.

Plugin


Kooboo is an extensible framework. Developers can use standard ASP.NET MVC to write extensions. PagePlugin is a type of extensions without UI.

Kooboo offers 4 API methods in this type of extensions. You can use standard request.form or request.querystring to get desired data. Below screen is the defined interface for PagePlugin
    /// 
    /// 
    /// 
    public interface IControllerPlugin
    {
        /// 
        /// Initializes the specified controller.
        /// 
        /// The controller.
        void Initialize(CommonController controller);

        /// 
        /// Pres the get execute.
        /// 
        /// 
        /// if return not null,will return the ActionResult to skip the default logic.
        /// 
        ActionResult PreGetExecute();

        /// 
        /// Pres the post execute.
        /// 
        /// 
        ///  if return not null,will return the ActionResult to skip the default logic.
        /// 
        ActionResult PrePostExecute();

        /// 
        /// After the get execute.
        /// 
        /// The action result.
        /// 
        ActionResult AfterGetExecute(ActionResult actionResult);


        /// 
        /// After the post execute.
        /// 
        /// The action result.
        /// 
        ActionResult AfterPostExecute(ActionResult actionResult);
    }


Components


You can insert components into a page. Components include Content template and module, each with a different icon. Positions are defined in the layout template.

Select a position and insert a component. If a Content template contains parameters, you can assign a value to a parameter directly. The property defined in the content template can also directly define some enum values like below example.
Kooboo page add component
There is another way of adding components into a page. On the top menu of page window, click the menu called "visual design", it will open the visual designer. You can then drag and drop components into page positions.
Kooboo adding components to page
For content template, you can also quickly add content template to pages by right click on the content template at the content template list page.
Kooboo content template to pages
This will open below window for you to quickly adding components to pages.
Kooboo adding commponents to page