home > support > web design > introduction to tags
One of the key aspects of TourCMS, or any other content management system, is how you can use the data that has been entered into the system. This content includes tour descriptions, dates, prices and special offers.
For building web pages, TourCMS uses two kinds of tags. Firstly tags for individual data - we call these element tags. Secondly there are tags that create lists. As these require a start and an end, we call these container tags. They work in the same way as HTML container tags.
Web page building
Within TourCMS or within an external web page editor, page templates are created & edited. These templates combine HTML with the TourCMS tags. When the site is rebuilt, the tags are stripped out of the templates and are replaced with actual data. The final pages are then FTPed to your webserver in their final position.
Element tags
<$TourCMStour output="t_name"$> <$TourCMSdeparture output="d_offer_price"$>
Container tags
<TourCMSlist_departures orderby="offer_datetime" order="desc" bookable="show" has_offer="show" maxdisplay="3">
Attributes
The example above, TourCMSlist_departures, is a container tag that lists departures. Extra requirements can be defined using attributes. These attributes enable the web designer to dictate exactly what data should be returned. In the example above we have used:
Combining container tags with element tags
The power of the tags system increases when container tags are combined with element tags.
<TourCMSlist_departures orderby="offer_datetime" order="desc" bookable="show" has_offer="show" maxdisplay="3"> <$TourCMStour output="t_name"$> </TourCMSlist_departures>
The above example encloses an element tag with a container tag. The container tag repeats its contents for each departure that has a special offer. The element tag itself is a tag to display the tour name. We could end up with a list of 3 tour names like this:
Luxury Paris
Luxury London
Luxury Amsterdam
In addition we could add an extra element tag to display the special offer price:
<TourCMSlist_departures orderby="offer_datetime" order="desc" bookable="show" has_offer="show" maxdisplay="3"> <$TourCMStour output="t_name"$> <$TourCMSdeparture output="d_offer_price"$> </TourCMSlist_departures>
In our example this would create a list of tour names and offer prices such as:
Luxury Paris 500
Luxury London 300
Luxury Amsterdam 200
Building a table in HTML
Most of the time we will want to display this information in HTML rather than as a text list. The following example shows how the tags will integrate with HTML within the page templates:
<table cellspacing="2" cellpadding="2" border="1"> <TourCMSlist_departures orderby="offer_datetime" order="desc" bookable="show" has_offer="show" maxdisplay="3"> <tr><td><$TourCMStour output="t_name"$></td> <td><$TourCMSdeparture output="d_offer_price"$></td></tr> </TourCMSlist_departures> </table>
Which creates:
<table cellspacing="2" cellpadding="2" border="1"> <tr><td>Luxury Paris</td><td>500</td></tr> <tr><td>Luxury London</td><td>300</td></tr> <tr><td>Luxury Amsterdam</td><td>200</td></tr> </table>
... and displays as:
Luxury Paris | 500 |
Luxury London | 300 |
Luxury Amsterdam | 200 |