2017 © Pedro Peláez
 

craft-plugin entitle

AP-style title capitalisation for Craft CMS.

image

experience/entitle

AP-style title capitalisation for Craft CMS.

  • Sunday, April 1, 2018
  • by experience
  • Repository
  • 1 Watchers
  • 16 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Entitle

Build Status, (*1)

Entitle is a Craft plugin which makes it easy to apply AP-style title capitalisation rules to the text on your website., (*2)

Requirements

Each release of Entitle is automatically tested against PHP 7.1 and above. It's also manually tested on the most recent version of Craft., (*3)

PHP 7.0 support

In theory, Entitle should be compatible with PHP 7.0. In practise, it's impossible to test this, because the Codeception dependency tree includes components which only work with PHP 7.1+., (*4)

Unfortunately there's nothing we can do about that., (*5)

Installation

To install Entitle, either search for "Entitle" in the Craft Plugin Store, or add it as a Composer dependency., (*6)

Here's how to install Entitle using Composer., (*7)

  1. Open your terminal, and navigate to your Craft project:, (*8)

    cd /path/to/project
  2. Add Entitle as a project dependency:, (*9)

    composer require experience/entitle
  3. In the Control Panel, go to "Settings → Plugins", and click the "Install" button for Entitle, (*10)

Configuration

Entitle allows you to specify "protected" words, which are not subject to the AP capitalisation rules. This is useful for ensuring that acronyms, brand names, and the like are not modified., (*11)

After installing Entitle (as described above), navigate to its settings page, and enter your "protected" words as a comma-delimited string., (*12)

Usage

There are three ways to use Entitle:, (*13)

  • As a Craft service.
  • As a template variable.
  • As a Twig filter.

Service

The Entitle service exposes a single method, capitalize. The method accepts an input string, and returns the correctly-capitalised result., (*14)

// Result: 'Of Mice and Men'
Entitle::getInstance()->entitle->capitalize('of mice and men');

Template variable

Entitle exposes a single template variable, capitalize. As with the service method of the same name, it accepts an input string, and returns the correctly-capitalised result., (*15)

// Result: 'Fear and Loathing in Las Vegas'
{{ craft.entitle.capitalize('fear and loathing in las vegas') }}

Twig filter

Entitle exposes a single Twig filter, entitle., (*16)

// Result: 'The Hound of the Baskervilles'
{{ 'the hound of the baskervilles'|entitle }}

The Versions

01/04 2018

dev-master

9999999-dev

AP-style title capitalisation for Craft CMS.

  Sources   Download

MIT

The Requires

  • php ^7.1.0

 

The Development Requires

by Stephen Lewis

01/04 2018

2.0.0

2.0.0.0

AP-style title capitalisation for Craft CMS.

  Sources   Download

MIT

The Requires

  • php ^7.1.0

 

The Development Requires

by Stephen Lewis