Tag Archives: type

Concrete5: How to exclude a certain page type from your autonav menu

Here is how I exclude specific page types from an autonav menu in Concrete5.

Navigate to concrete/blocks/autonav and open the view.php file.

Scroll down to this line:

foreach($aBlocks as $ni) {
		$_c = $ni->getCollectionObject();
		if (!$_c->getCollectionAttributeValue('exclude_nav')) {

Add this block of code:

$typeHandle = $_c->getCollectionTypeHandle();
			if($typeHandle!="page_type"){

Change “page_type” to the handle of page type that you want to exclude from your autonav menu (for example: blog_post).

Now scroll down and add “}” after this line:

$lastLevel = $thisLevel;
			$i++;

You can also see or download the edited view.php here (this is a text file, so if you want to use it, make sure you save it as a php file!!).