don't include page aliases in date nav

Permalink
any way to modify the date nav to not include aliased pages similar to the option we have for page lists?

 
jordanlev replied on at Permalink Reply
jordanlev
Override the view template by copying YOURSITE/concrete/blocks/date_nav/view.php to YOURSITE/blocks/date_nav/view.php (you'll need to create the YOURSITE/blocks/date_nav directory first). Then edit that new file, find this line (should be around line #99):
echo "\t\t <li class='monthsPage pageNode ".$selected." pageId".intval($page->getCollectionId())."' >";

and just BEFORE that line, add this:
if ($page->getCollectionAttributeValue('exclude_nav')) {
    continue;
}


I *think* that should work (although I haven't tested it myself).

Note that it doesn't do anything in regards to hiding months/years that have only excluded items in them (so if you had only 1 item in May 2011 and that item was excluded, the nav would show the "May" heading but there would be no items in it). Getting it to do this would require a decent amount of work.

Hope that helps.

-Jordan
jordanlev replied on at Permalink Best Answer Reply
jordanlev
Jeez, I just realized that wasn't your question at all! (And looking through the date_nav code, it already should be excluding items that are marked "exclude from nav").

So... instead I think you can override the controller file and add in this line:
$pl->filterByIsAlias(0);

somewhere in the getPages function (maybe add it under the "$pl->filterByAttribute('exclude_nav',false);" line, around line #79).

I think you can override the controller.php in the same way as the view.php file, so adjust my earlier instructions accordingly.
jhart replied on at Permalink Reply
perfect. thank you!