Data Access Worldwide Knowledge Base

Article ID 2266
Article Title HOWTO: Add an agenda to your website
Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2266
KBase Category ELECTOS
Date Created 11/26/2006
Last Edit Date 12/06/2006


Article Text
This item tells you how you can create an agenda on your Electos website using the standard tools. Version 2 of Electos is used for the article. You can see an example of the agenda that is described in this topic on www.dataaccess.nl (look at the bottom at the right-hand side of the home page). The agenda there shows 3 items while the link "full agenda" shows all the active agenda items.

The agenda is built on a multi-item page. A common use of the multi-item page is the News section. Each news item is a document and the standard templates show the first 250 characters of the news article in the news area of the website. Users can click the item to read more of the news item. Agenda items are not much different from this except that the agenda should not list a part of the full text but only the dates and a subject. One of the major advantages of a multi item page is that we can easily reorganise the agenda items and we can schedule their visibility (accessiblity). This means that items that are no longer valid (date passed) are removed from the agenda without user action and new items can move in.

Before you start creating agenda items it would be better to create a document structure first with the items you want to have for the agenda organization. For the Data Access Europe agenda we created a document structure with 9 structure items. You are of course free to setup your own structure. We created:

Name, Title, Type, Width
Item, Item, Single Line text, 40
Year, Year, Single Line text, 4
Month, Month, Single Line text, 15
Days, Days, Single Line text, 25
City, City, Single Line text, 40
Country, Country, Single Line text, 40
Descr, Descr, Single Line text, 50
Title, Title, Single Line text, 50
MoreInfo, MoreInfo, Multi Line text, 548

What is stored in the above items when you create a document on this? In item we store the agenda item type (e.g. Developers conference). Instead of one date field we split the date in 3 parts (year, month and days). The year item contains a year (e.g. 2007). The month is used to store the (abbreviated) month name. We use a month name to avoid that people get confused about the agenda item. Such a thing can easily happen with dates like 11/12/2006. Is that Nov.12 of Dec.11? The days can be a single day or a value like 11-13, another reason for not using a date item. City and Country speak for themselves. The descr is a value used in the short agenda list while the title can be used to display more information about the agenda item. The MoreInfo item can contain any text you want to expose that tells more about the agenda item, about the event.

Besides the creation of document structure we also need to create two new ASP templates. One named Agenda.Asp and another one called AgendaMoreInfo.Asp. Agenda.Asp can start as a copy of News.Asp and AgendaMoreInfo.Asp as a copy of Normal.Asp.

Next to the creation of two new ASP files you probably want to modify your main asp file so that the first couple of items show at the start page. We added the following code to our home.asp:

<table class="Normal" cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
    <%
    Dim iAgendaPageId
    iAgendaPageID = oPublisher.call ("Get_PageIDByLabel", "Agenda")

    iNewsID = oPublisher.call ("GET_PageID", iAgendaPageId)
    iNumberOfItems = oPublisher.call ("GET_CountChildren", iNewsID)

    If iNumberOfItems > 3 Then iNumberOfItems = 3

    For iCounter = 1 To iNumberOfItems
        iChildPageID = oPublisher.call ("GET_ChildPageID", iNewsID, iCounter)
    %>
    <tr>
        <td colspan="2">
            <strong>
                <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Year"%>,
                <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Month"%>
                <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Days"%>,&nbsp;
                <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Item"%>
            </strong>
        </td>
    </tr>
    <tr>
        <td />
        <td>
            <% sChildASPTemplate = oPublisher.call ("GET_ASPTemplate", iChildPageID) %>
            <a href="<%=sChildASPTemplate%>?pageid=<%=iChildPageID%>"><%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Descr"%></a>,&nbsp;<%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Country"%>
        </td>
    </tr>
    <%
    Next
    %>
    </tbody>
</table>

The first three items from the agenda multi-item page are printed in a table using two rows for each item. The PageIdByLabel is a neat function to find a particular Electos page number and not using a static page number.

The Agenda.Asp was modified by replacing the inner part of the loop that processes the news items with:

<%sChildASPTemplate = oPublisher.call ("GET_ASPTemplate", iChildPageID)%>
<tr>
    <td><a href="<%=sChildASPTemplate%>?pageid=<%=iChildPageID%>"><img border="0" src="Images\Arrow_News.Gif"></a></td>
    <td>
        <strong>
            <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Year"%>,
            <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Month"%>&nbsp;
            <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Days"%>,&nbsp;
            <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Item"%>
        </strong>
    </td>
</tr>
<tr>
    <td />
    <td>
        <%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Descr"%>,&nbsp;<%oPublisher.call "Msg_PrintPageItem", iChildPageID, "Country"%>
    </td>
</tr>

The AgendaMoreInfo.Asp is modified with the following ASP information;

<table class="Normal" cellspacing="0" cellpadding="0" width="100%" border="0">
    <tbody>
        <tr>
            <td class="Heading3">
                Date: <%oPublisher.call "Msg_PrintPageItem", iPageID, "Month"%>
                <%oPublisher.call "Msg_PrintPageItem", iPageID, "Days"%>,
                <%oPublisher.call "Msg_PrintPageItem", iPageID, "Year"%>
                <br />
                Location: <%oPublisher.call "Msg_PrintPageItem", iPageID, "City"%>,&nbsp;
                <%oPublisher.call "Msg_PrintPageItem", iPageID, "Country"%>
                <br /><br />
            </td>
        </tr>
        <tr>
            <td>
                <%oPublisher.call "Msg_PrintPageItem", iPageID, "MoreInfo"%>
            </td>
        </tr>
    </tbody>
</table>

Now we have all the code and the document structure in place we can create a multi-item page on the site management side of Electos Studio. Each of the multi-item page items should be one of the Agenda structure item. For a good organization of the website, create a folder in the content named agenda and store the documents - created for each agenda item - in that folder.


Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu


Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.

The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.