Kartris User Guide

14.1. Adding new pages

One of the most common modifications developers might want to make to extend Kartris is to add new pages. For simple text pages, there is the built in CMS system (see @8. Custom Pages - Basic CMS‍). But if you need to add a functional page that contains some programming logic, you will need to add actual .aspx pages to the site.

 

In order to integrate properly into your Kartris site, you'd want the new page to inherit the Kartris skin and features such as the basket and menus. You will want the new page to appear on menus, and also in the breadcrumb trail.

Here is a guide to adding a new page, which we will call 'Test'.

 

First, create a new page in your root called Test.aspx, with a code behind (Test.aspx.vb). The aspx page content will be as follows:

<%@ Page Language="VB" MasterPageFile="~/Skins/Kartris/Template.master" AutoEventWireup="false"
    CodeFile="Test.aspx.vb" Inherits="Test" %>

<asp:Content ID="cntMain" ContentPlaceHolderID="cntMain" runat="Server">
    <user:BreadCrumbTrail ID="UC_BreadCrumbTrail" runat="server" EnableViewState="False" />
    Your new content can go here
</asp:Content>

The code behind is even simpler, and will look like this:

Partial Class Test
    Inherits PageBaseClass
End Class

Note that this page inherits from PageBaseClass rather than the standard System.Web.UI.Page class. This ensures it picks up all the special Kartris page features, and employs Kartris security. So for example, if your site is set to require people to login to be able to view pages, this page will enforce that rule too.

To get your pages to appear in the navigation menu, and the breadcrumb trail, you will need to add references to them in a couple of places. Firstly, the web_menu.sitemap file (see @8.4. Site menus‍).

 

For the breadcrumb trail, you will need to add references for your new page in web_breadcrumb.sitemap (also located in the root of the web).

 
powered by tomehost