keywords and description generating without controller/action
register 2 plugin in bootstrap
// register navigation, $view->navigation()->setContainer( new Zend_Navigation( $navigationArray ) );
$controller = Zend_Controller_Front::getInstance();
$controller->registerPlugin(new App_Controller_Plugin_PrepareNavigation());
$controller->registerPlugin(new App_Controller_Plugin_SetMeta());
Meta plugin could look like:
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
$view = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view;
$activePage = $view->navigation()->findOneBy('active', true);
$view->headTitle($activePage->title);
$view->headMeta()->appendName('keywords', $activePage->keywords );
$view->headMeta()->appendName('description', $activePage->description );
$view->pageHeader = $activePage->pageHeader;
}
navigationArray would be than:
'pages' => array(
array( 'label' => 'introduction',
'controller' => 'controller',
'action' => 'introduction',
'route' => 'controlleraction',
'pageHeader' => 'h1 or something',
'title' => 'used as meta title'
'keywords' => 'meta keywords'
'description' => 'meta desc',
than you can simple call (from layout/view) print $this->pageHeader;