Management of page title and og:meta informations through config file

dev-master 2015-06-30 19:07 UTC

This package is not auto-updated.

Last update: 2023-03-18 08:05:07 UTC



Provides control over page title/og:meta information from route


The suggested installation method is via composer:

php composer.phar require mfcc/title-manager:dev-master


  1. Enable MfccTitlemanager module in your application.config.php file.
'modules' => array(
  1. Set options in your base module.config.php
'MfccTitleManager' => array(
    		'defaultTitle' => 'Ladíme v praxi | Pardál',
    		'baseTitle' => 'Ladíme v praxi',
    		'defaultDescription' => 'Začni s Pardálem ladit pivní vychytávky! Uděláš něco záslužného pro hospodské lidstvo a ještě můžeš vyhrát pivo a další ceny od Pardála.',
    		'defaultImages' => array( 'img/fb/ladime-v-praxi-fb-share-01.jpg',
  1. Options available in base module.config.php:
defaultTitle /* title to show on pages where no title is given */
baseTitle /* base part of component title, i.e. "mfcc page" */
titleSeparator /* string to separate BaseTitle and SubTitle */
titlePrepend /* display BaseTitle TitleSeparator SubTitle when true and SubTitle TitleSeparator BaseTitle when false, defaults to false */
defaultDescription /* default page description */
defaultImages => (array(string)) /* array of paths or urls to default images */
defaultImage => (string) /* single path or url to default image */
  1. Set information in your route. i.e:
  'gallery' => array(
            		'type'    => 'Literal',
            		'options' => array(
            				'route'    => '/galerie-ladeni',
            				'defaults' => array(
            						'__NAMESPACE__' => 'Application\Controller',
            						'controller'    => 'Gallery',
            						'action'        => 'index',
   /* MfccTitleManager entry */
	           		'title_manager' => array(
            			'sub_title'=>'Sub Title­',
            			'description'=>'Fancy description of given page.',
            			'images'=> array('img/fb/fb-promo-image.jpg'),
  1. Options available in config:
title => Complete title of page
sub_title => prepend or append to set base title
description => description of current page
images => images for current page
none => don't use title_manager for this page (probably will be set manually in controller)
  1. shortcuts for manual setting of page info:
  $tm = $this->serviceManager('titleManager');
  .. or ..
  setSubTitle(); /* create title by prepending or appending to base title */