2017 © Pedro Peláez
 

library title-manager

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

image

mfcc/title-manager

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

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Total Downloads

MfccTitleManager

Provides control over page title/og:meta information from route, (*1)

Install:

The suggested installation method is via composer:, (*2)

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

Usage:

  1. Enable MfccTitlemanager module in your application.config.php file.
'modules' => array(
        ...,
        ...,
        ...,
        'MfccTitleManager',
        ...,
        'Application',
    ),

  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', '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') )
  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');
  $tm->titleManager->setTitle();

  .. or ..

  setSubTitle(); /* create title by prepending or appending to base title */
  setImages(array);
  setDescription;

The Versions

30/06 2015

dev-master

9999999-dev https://github.com/jonsource/mfcc-titlemanager

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

  Sources   Download

MIT

The Requires

 

service zf2 html zend title open-graph description