mfcc / title-manager
Management of page title and og:meta informations through config file
dev-master
2015-06-30 19:07 UTC
Requires
- php: >=5.3.0
- zendframework/zendframework: >=2.1
This package is not auto-updated.
Last update: 2024-12-21 16:30:59 UTC
README
MfccTitleManager
Provides control over page title/og:meta information from route
Install:
The suggested installation method is via composer:
php composer.phar require mfcc/title-manager:dev-master
Usage:
- Enable MfccTitlemanager module in your application.config.php file.
'modules' => array( ..., ..., ..., 'MfccTitleManager', ..., 'Application', ),
- 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', 'img/fb/ladime-v-praxi-fb-share-02.jpg', 'img/fb/ladime-v-praxi-fb-share-03.jpg', 'img/fb/ladime-v-praxi-fb-share-04.jpg', 'img/fb/ladime-v-praxi-fb-share-05.jpg', 'img/fb/ladime-v-praxi-fb-share-06.jpg') )
- 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 */
- 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'), ),
- 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)
- shortcuts for manual setting of page info:
$tm = $this->serviceManager('titleManager'); $tm->titleManager->setTitle(); .. or .. setSubTitle(); /* create title by prepending or appending to base title */ setImages(array); setDescription;