2017 © Pedro PelĆ”ez
 

silverstripe-vendormodule metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

image

kinglozzer/metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  • Friday, November 10, 2017
  • by kinglozzer
  • Repository
  • 4 Watchers
  • 16 Stars
  • 63,651 Installations
  • PHP
  • 8 Dependents
  • 2 Suggesters
  • 4 Forks
  • 0 Open issues
  • 10 Versions
  • 7 % Grown

The README.md

MetaTitle

Build Status Latest Stable Version Total Downloads License, (*1)

Re-adds the ā€œMeta Titleā€ field that was removed in SilverStripe 3.1., (*2)

By: Loz Calver - Bigfork Ltd., (*3)

Contributing:

Translations were pulled from SilverStripe CMS v3.0.2 (before the SiteTree.METATITLE entity was removed). Pull requests are welcome for improving those translations and adding SiteTree.METATITLEHELP translations., (*4)

Requirements:

This module requires SilverStripe Framework & CMS version 5 and up:, (*5)

  • "silverstripe/cms": "^5"
  • "silverstripe/framework": "^5"

For a SilverStripe 3 compatible version, please use the 1.x line of releases (with composer, require version ^1.0)., (*6)

Installation:

Installation with Composer is preferred, but not required. Both methods of installation require a dev/build., (*7)

Composer

$ composer require kinglozzer/metatitle:^3.0

ZIP Download

Simply download the zip version of this repository, extract it, and copy the directory into your SilverStripe installation., (*8)

Usage:

CMS

Content authors can edit the meta title via the new ā€œMeta Titleā€ field thatā€™s added to the ā€œMetadataā€ toggle fields:, (*9)

, (*10)

Templates

Automatically including the meta title

The simplest way to ensure that the meta title is included is to call $MetaTags in the <head> of your template. This will include the meta title (falling back to page title if meta title is not set) and the site name in the format: Meta title Ā» Your Site Name., (*11)

The format can be customised by changing the Kinglozzer\SilverStripeMetaTitle\MetaTitleExtension.title_format config setting. For example, to change the Ā» to a hyphen:, (*12)

Kinglozzer\SilverStripeMetaTitle\MetaTitleExtension:
  title_format: '$MetaTitle - $SiteConfig.Title'

The title_format string is rendered as a template, so you can use globally available variables like $SiteConfig. $MetaTitle is dynamically populated with the meta title (falling back to page title if meta title is not set)., (*13)

Manually including the meta title

You can access the meta title directly with the $MetaTitle variable, should you wish to control how the meta title is output directly in your template. You will need to call $MetaTags(false) to ensure that SilverStripe doesnā€™t automatically output the <title> tag too:, (*14)

<title><% if $MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> &raquo; $SiteConfig.Title</title>
$MetaTags(false)

The Versions

10/11 2017

dev-master

9999999-dev https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe title meta metatitle

10/11 2017

2.0.3

2.0.3.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe title meta metatitle

08/11 2017

2.0.2

2.0.2.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe title meta metatitle

31/07 2017

2.0.1

2.0.1.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe title meta metatitle

05/10 2016

2.0.0

2.0.0.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe title meta metatitle

05/10 2016

2.0.0-beta1

2.0.0.0-beta1 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 4

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

silverstripe title meta metatitle

27/02 2016

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 3.1

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe title meta metatitle

09/01 2015

1.0.2

1.0.2.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 3.1

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe title meta metatitle

23/04 2014

1.0.1

1.0.1.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 3.1

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe title meta metatitle

14/02 2014

1.0.0

1.0.0.0 https://github.com/kinglozzer/silverstripe-metatitle

Re-adds the 'MetaTitle' field for SilverStripe 3.1

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe title meta metatitle