Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<5.2.5. Building a Home Page Template        5.2.7. Environmental Control with Campsite Templates>

Print / Download:
Available languages: english Last update: 2005-10-12 08:05:46

5.2.6. Powerful Lists and Ordering

Listing and ordering are two powerful functions in Campsite lingo. In the following example we would like to automate an update for the sections 3, 4 and 5. Whenever an editor posts some new articles in either of these sections and publishes them, we want the home page to display a link to the newest article in the center column. Also, we want the second newest posting to be listed in the left column.

In order to achieve this, our home page template needs to select sections 3, 4 and 5, then order them from newest to oldest and take the top entry for the center and the second one for the left column.

What do we need to do?

<!** list length 3 section number greater 2>

This will select the sections 3, 4, and 5.

<!** list length 1 article order bynumber desc>

This line orders the entries from newest to oldest and only returns the newest article, because the length of the list is set to one.

<!** print section name>
<!** print article title>

...to print the most recent for each section.

<!** endlist>
<!** endlist>

... to close the list again.

So, now we need to take the second articles for each section to go into the column on the left. This can be done similar to the example above:

<!** list length 3 section number greater 2>
<!** list length 2 article order bynumber desc>
<!** if list index 1><!** else>
<!** print section name>
<!** print article title>
<!** endlist>
<!** endlist>


add a note add a note User Contributed Notes
5.2.6. Powerful Lists and Ordering
There are no user contributed notes for this page.

<5.2.5. Building a Home Page Template 5.2.7. Environmental Control with Campsite Templates>

  Last update: 2005-10-12 08:05:46
Website powered by Docmint Last update: 2005-10-12 08:05:46
Total page time: 1.13256287575