Index: library/Zend/Navigation/Page.php =================================================================== --- library/Zend/Navigation/Page.php (revision 21284) +++ library/Zend/Navigation/Page.php (working copy) @@ -88,6 +88,13 @@ protected $_rev = array(); /** + * rel="nofollow" attribute for anchors + * + * @var bool + */ + protected $_noFollow; + + /** * Page order used by parent container * * @var int|null @@ -565,6 +572,38 @@ } /** + * Set if rel="nofollow" attribute should be included in the anchor tag + * + * @param bool $noFollow [optional] If true, rel="nofollow" will be + * included in the anchor tag. + * @return self Fluent interface, returns self + */ + public function setNoFollow($noFollow = false) + { + if (is_bool($noFollow)) { + $this->_noFollow = $noFollow; + } + + return $this; + } + + /** + * Returns if rel="nofollow" attribute should be included in the anchor tag. + * If false: return null, if true: returns 'nofollow' so this method can + * directly be called by the _htmlAttribs methods in the view helpers. + * + * @return null|string Returns null or 'nofollow' + */ + public function getNoFollow() + { + if (true === $this->_noFollow) { + return 'nofollow'; + } + + return null; + } + + /** * Sets page order to use in parent container * * @param int $order [optional] page order in container. Index: library/Zend/View/Helper/Navigation/HelperAbstract.php =================================================================== --- library/Zend/View/Helper/Navigation/HelperAbstract.php (revision 21284) +++ library/Zend/View/Helper/Navigation/HelperAbstract.php (working copy) @@ -670,11 +670,12 @@ // get attribs for anchor element $attribs = array( - 'id' => $page->getId(), - 'title' => $title, - 'class' => $page->getClass(), - 'href' => $page->getHref(), - 'target' => $page->getTarget() + 'id' => $page->getId(), + 'title' => $title, + 'class' => $page->getClass(), + 'href' => $page->getHref(), + 'target' => $page->getTarget(), + 'rel' => $page->getNoFollow() ); return '_htmlAttribs($attribs) . '>' Index: library/Zend/View/Helper/Navigation/Menu.php =================================================================== --- library/Zend/View/Helper/Navigation/Menu.php (revision 21284) +++ library/Zend/View/Helper/Navigation/Menu.php (working copy) @@ -226,7 +226,8 @@ $attribs = array( 'id' => $page->getId(), 'title' => $title, - 'class' => $page->getClass() + 'class' => $page->getClass(), + 'rel' => $page->getNoFollow() ); // does page have a href?