Skins

How do I limit the number of archive links in my archive list?

Scenario:
"I only want my archive list to show a maximum of X links to each monthly archive. What do I need to do?"

Solution:
The <%archivelist%> variable has two extra parameters, category and limit. Use it as follows:

<%archivelist(templatename,category,limit)%>

where templatename is the name of the template where the format of your archive list is defined, category is the category you want to restrict the archive list to (i.e. show only archives for a given category) and limit is the maximum number of archive links to show.

For example, if you want to show only 5 archive links for all categories, use:

<%archivelist(templatename,,5)%>

Note that you need TWO commas between templatename and limit.

Original forum thread:
http://forum.nucleuscms.org/viewtopic.php?t=7566

section: Skins | submitted by Leng on 2007.Feb.01 | 1823 views

item rate
This answer was not rated yet.

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10