Returns an array of year / month links for navigating an archive nav. Each array Item will be an array describing that nav link.
$type (ENUM)
- all: All documents or nodes included in this node.
- allbaseonly: All documents or nodes which have this node as their base node.
- document: Documents included within this node.
- documentbaseonly: Just documents which have this node as their base node.
- node: Just nodes which are immediate children of this node
ARRAY
$nodenav->getArchiveYearsAndMonths('document');
<?php if($archivenav = $newsnav->getArchiveYearsAndMonths('all') && isset($archivenav['years']) && count($archivenav['years']) > 0){ ?> <ul id="archivenav"> <?php foreach($archivenav['years'] as $year=>$yearvals) { ?> <li> <a href="#"><?php echo htmlspecialchars($year) ?></a> <ul> <?php foreach($yearvals['months'] as $month=>$detail) { ?> <li><a href="/news/<?php echo $this->obj_tokenmanager->getURL( '' , array( 'month' => $year . '-' . $month ) ); ?>"><?php echo htmlspecialchars(date("F", mktime(0, 0, 0, $month, 10))) ?></a></li> <?php } ?> </ul> </li> <?php } ?> </ul> <?php } ?>