Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<5.2.4.1. The 'Feature' article of the section        5.2.4.3. Including Images in the Section Listing>

Print / Download:
Available languages: english Last update: 2005-08-04 13:06:55

5.2.4.2. Displaying only the most recent feature article on a section page

To use just the most recent article from the 'feature' articles in the section, use the following tag:

<!** list length 1 article onsection is on order bynumber desc>
<a href="<!** URI article>"><!** print article name></a>
<!** end list>

This will create a list of articles (in our case only one, as the length is set to 1) of the articles marked as 'show on section'. The list will be ordered by descending numbers, the highest entry being featured on the top. As set in this example, this will result in only the most recent entry of "feature" articles within the section being shown.

A link is then created, containing the name of the article (which is the title).

Note: If you have built your list in the way described above, only the first article is included. Imagine you have three or four articles checked to 'show on section page', all but the most recent one will be swallowed. This might make sense in some cases, but it might be problematic for other designs.

It might be better to make sure that we are printing the most recent marked one, then the other marked ones and finally the normal articles in the section. So we will keep the first command for our feature article in the section. Then we need to make a list of all articles that are also checked to be 'on section page'. But we need to exclude article number one.

<** list article onsection is on order bynumber desc>
<!** if list index 1><!** else>
...
<!** endif>
<!** endlist>

This will build the list of all checked articles in the section. It will then look at the index of each article, once it has ordered them. So the newest article will have the index number one. The if condition will find this article and do nothing - because - it runs straight into the 'else' area. Above, where you can see the three dots, you can add your own listing, using the normal 'print article' tag and your HTML code.

Finally, all we need to do is list the remaining articles. That's an easy task--simply exclude the marked ones and list the rest. There you go:

<** list article onsection is off order bynumber desc>
...
<!** endlist>

Again, include your HTML with the other variables in-between.


add a note add a note User Contributed Notes
5.2.4.2. Displaying only the most recent feature article on a section page
There are no user contributed notes for this page.

<5.2.4.1. The 'Feature' article of the section 5.2.4.3. Including Images in the Section Listing>

  Last update: 2005-08-04 13:06:55
Website powered by Docmint Last update: 2005-08-04 13:06:55
Total page time: 0.661698818207