Glossary Item Box

Site templates: Site templatesContent templatesMain image pagePrint version template

General: CMS architectureOverview

See Also CmsDeveloperGuide Send comments on this topic.

Default page template

For a work of a site it is necessary to adjust the first page of the site (home page).


On this page it could be placed text blocks, blocks with news, pages tapes and any other module that supports an output of its content in any place of a site. This is supported by the following modules:

 

You simply insert a tag from the required module to the page with the help of MenuItemGuid attribute and attach it to a corresponding menu item.

 

A file of the first page lies in a folder modules/default.ascx and can look as following:

<%@ Control Language="c#" Inherits="CMSLib.Pages.SiteControl" %>
<%@ Register TagPrefix="cmsp" Namespace="CMSLib.Modules.Page" Assembly="CMSLib" %>
<%@ Register TagPrefix="cmsn" Namespace="CMSLib.Modules.News" Assembly="CMSLib" %>

<table width="100%" cellpadding="0" cellspacing="0" border="0" height="100%">
<tr><td>
    <cmsp:Page ID="Page1" runat="server" MenuItemGuid="651d9451-e5ea-43fe-a56a-1e3243b36b75" />
</td></tr>
<tr><td>
    <cmsn:News id="News1" PageSize="5" runat="server" MenuItemGuid="72d11e86-5873-4ccf-8dc0-d6acbe733fbe">
    <TEMPLATE>
        <div><a href="<%# Container.Url %>"><%# Container.Date %> <%# Container.MenuName %>: <%# Container.Text %>
        <div> </div><u>More</u></a></div>
    </TEMPLATE>
    <TemplateWithoutLink>
        <div><%# Container.Date %> <%# Container.MenuName %>: <%# Container.Text %></div>
    </TemplateWithoutLink>
    </cmsn:News><br />
    <a href="/?item=72d11e86-5873-4ccf-8dc0-d6acbe733fbe" title="All news">All news</a>
</td></tr>
<tr><td>
    <cmsp:PageList id="Pagelist1" runat="server" PageSize="3" OrderByStatement="Date, Head" ShowArticlesInArchive="False" MenuItemGuid="6072578d-44d1-43fd-a86b-bf1383cdf202">
    <TEMPLATE>
        <a href="<%# Container.PathToFullPage %>"><h5>
        <%# Container.IsDate ? "<u>" + Container.Date + " - " : "" %>
        <%# Container.Head %></u></h5><br />
        <%# Container.Annotation %>
        <div><u>More...</u></div></a><br />
    </TEMPLATE>
    <TemplateWithoutText>
        <h5><%# Container.IsDate ? "<u>" + Container.Date + " - " : "" %>
        <%# Container.Head %></u></h5><br />
        <%# Container.Annotation %><br />
    </TemplateWithoutText>
    </cmsp:PageList>
</td></tr>
</table>

 

In this example on the first page of the site a text block, then a news tape and then a pages tape are placed.

Site templates: Site templatesContent templatesMain image pagePrint version template

General: CMS architectureOverview

 

 


© 2005-2007 Astron Digital Ltd. All Rights Reserved.