help.axcms.net Axinom Logo

Developing Lists

How to develop a list of pages/documents with AxCMS.net.

A list is a pattern used with AxCMS.net very frequently. A list can be used for a lot of things: News, Announcements, Press Releases, Jobs, etc., etc. Here is an example of such a list:

List Sample (News)

To implement a list you would typically use Pages/Documents and Categories. Every list item is going to become a Page/Document on its own. It contains the content shown if an user selects one of the items. Page/Document meta information (Headline, Description, Date, etc.) are used to present the list. For every list a list category is created. All list items are classified into this category. A list element (dynamic structure element) gets the list category as a parameter, loads all list items from this category and renders them in a paricular way. As with navigation you see, the logic content structure (which Pages belongs to which list) is independent from the user interface. How the list looks like is defined in the list element and can be project specific.

We will start with a simple example and add more and more features gradually.

Creating a simple List

First let's create a list category - Categories / Lists / myList for the sake of this sample.

Then pick 3-4 pages (or create new pages) and classify into this category, so that we have a source for our list.

Now we create a list element myList.ascx. It is going to be a dynamic element. We will start without any parameter and hard code the list category. Later we will add some parameters with a nice custom editor.

    <ElementTemplateDefinition axid="myList" description="My List">
      <Behaviour>Dynamic</Behaviour>
      <File>DynamicControls/MyList.ascx</File>
    </ElementTemplateDefinition>

The visual part of the list will be a simple Repeater with some CSS:

TODO