In the controller, you can get the current active page and get its shortcut. Then you can specify it as the page title.
$activePage = $this->view->navigation()->findOneBy('active', true);
$label = $activePage->get('label');
$this->view->headTitle($label);
You can also write your own plugin to do this for you in each request:
class Plugin_NavigationTitle extends Zend_Controller_Plugin_Abstract
{
function preDispatch(Zend_Controller_Request_Abstract $request)
{
$view = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view;
$activePage = $view->navigation()->findOneBy('active', true);
$label = $activePage->get('label');
$view->headTitle($label);
}
}
source
share