2017 © Pedro Peláez
 

phile-plugin content-variables

A plugin to add custom variables in your content before it is parsed.

image

phile/content-variables

A plugin to add custom variables in your content before it is parsed.

  • Wednesday, March 7, 2018
  • by NeoBlack
  • Repository
  • 2 Watchers
  • 1 Stars
  • 104 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

phileContentVariables

A plugin for Phile to add custom variables in your content before it is parsed., (*1)

1.1 Installation (composer)

composer require phile/content-variables

1.2 Installation (Download)

  • Install the latest version of Phile
  • Clone this repo into plugins/phile/contentVariables

2. Activation

After you have installed the plugin. You need to add the following line to your config.php file:, (*2)

$config['plugins']['phile\\contentVariables'] = array('active' => true);

Usage

You must have a variables array in your config., (*3)

$config['variables'] = array(
  'site_title' => $config['site_title'],
  'base_url' => 'https://example.com/
);

These keys are the variables, and the value is what the replaced string will be. So now when you reference %base_url% in your markdown/textile/content pages, it will be rendered as your real base URL:, (*4)

This is a link to my [base URL](%base_url%)

Will be rendered as:, (*5)

<p>This is a link to my <a href="https://example.com">base URL</a></p>

Another example for a site with the title PhileCMS:, (*6)

Welcome to %site_title%!

Becomes:, (*7)

<p>Welcome to PhileCMS!</p>

Config

This plugin allows the open and close tags for your variables to be set. By default they are both set to the following:, (*8)

'open_tag' => '%', // the open tag for the variable
'close_tag' => '%' // the close tag for the variable

This means any text wrapped with % signs will be replaced., (*9)

The Versions

07/03 2018

dev-master

9999999-dev http://philecms.com

A plugin to add custom variables in your content before it is parsed.

  Sources   Download

MIT

The Requires

 

cms content phile

07/03 2018

1.0.1

1.0.1.0 http://philecms.com

A plugin to add custom variables in your content before it is parsed.

  Sources   Download

MIT

The Requires

 

cms content phile

07/03 2018

1.0.0

1.0.0.0 http://philecms.com

A plugin to add custom variables in your content before it is parsed.

  Sources   Download

MIT

The Requires

 

cms content phile