DotAdmin User Guide
News Archive Nav Templates
News archive navs are a special kind of Nav used to display links to documents created in a given time period. The Nav contains a page of links for every month in which a page or multiple pages were created, allowing the visitor to browse a large collection chronologically.
Note: A News Archive nav is a zone-based Nav. It will only show links to pages within a given zone. See the Nav System section for more information.
The links within a News Archive Nav, like a Paging Nav, all point to the same document but with arguments passed to tell the system which page of the Nav should be displayed:
http://www.site.com/content/{id}?nav={nav}&month={month}&year={year}
The three placeholders shown above; nav, month and year, are quite straightforward. They tell the system which Nav the arguments are intended for, and which month and year's links should be shown on the resulting page.
Like Paging Navs, a News Archive Nav employs a specialist BLOCK to display its information. This blocks is called BLOCK {months}.
BLOCK months
This block will repeat to create links for every calendar month for which there is content in the system. If we have content spanning three months in a given zone, the month block would repeat three times, creating a link for each month.
<h3>Archive</h3>
<ul>
<!-- BLOCK {months} -->
<li>
<a href="content/{id}?nav={nav}&month={month}&year={year}">
{month}/{year}
</a>
</li>
<!-- /BLOCK {months} -->
</ul>
<!-- BLOCK {pagelist} -->
(generate links to the actual content pages here)
<!-- /BLOCK {pagelist} -->
Creating a list of links in a News Archive Nav.
The example shown above might produce a menu like the one shown below:
Archive
- 2/2004
- 1/2004
- 12/2003
- 11/2003
- 10/2003
- 9/2003
The months block has one other set of placeholders, intended for use with conditional instructions: There is a month placeholder for each month of the year; {month1}, {month2}, and so on. By using these placeholders in conditional instructions, it is possible to output mark-up specific for each month.
The example below shows a drop-down <select> box being used to navigate between months. This time, instead of displaying the numeric month (as shown in our first example above), the monthly placeholders are used in conditional instructions to output each month's English name inside the Option tags.
<form name="archivenav">
<select name="month"
onChange="javascript:self.location=this.value">
<option>Please Choose...</option>
<!-- BLOCK {months} -->
<option value="/content/{id}?nav={nav}&month={month}
&year={year}">
<!--IF {month1} -->
January {year}
<!--/IF {month1} -->
<!--IF {month2} -->
February {year}
<!--/IF {month2} -->
(and so on…)
<!--IF {month12} -->
December {year}
<!--/IF {month12} -->
</option>
<!-- /BLOCK {months} -->
</select>
</form>
<!-- BLOCK {pagelist} -->
(generate links to the actual content pages here)
<!-- /BLOCK {pagelist} -->
Note: In the example above, the middle months are not shown to keep the example short. Conditional instructions for every month should be included in a complete, working template.
Below is a list of all placeholders used in News Archive Navs.
|
Placeholder
|
Output
|
|
{id}
|
The ID (url) of the document containing this nav. The document ID doesn't change between pages in a news archive nav.
|
|
{nav}
|
An ID used by the system to denote which Nav we are paging through.
|
|
{month}
|
Numeric representation of the month (1, 2, … 12).
|
|
{year}
|
Year, in the format YYYY.
|
|
{month<x>}
|
Used in conditional instructions to find which month is being displayed in a given repetition of a block. {month1} is January, {month2} is February, and so on.
|
|