1.11releasedTemplated Text Formatters

Templated Text Formatters allows you to create chains of text formatters as if they were one text formatter and/or create new text formatters based on installed templates. For example, it allows to chain Markdown and BBCode text formatters, so text will be formatted by Markdown first and than by BBCode.

Clone URLhttps://github.com/ahwayakchih/templatedtextformatters.git

Add as a submodulegit submodule add https://github.com/ahwayakchih/templatedtextformatters.git extensions/templatedtextformatters --recursive

Compatibility

2.x.x2.1.x2.2.x2.3.x2.4.x2.5.x2.6.x2.7.02.7.12.7.22.7.32.7.42.7.52.7.62.7.72.7.82.7.92.7.10
1.31.51.71.81.11NoNoNoNoNoNoNoNoNoNoNoNoNo. Soon?

Readme

Templated Text Formatters

  • Version: 1.11
  • Author: Marcin Konicki (http://ahwayakchih.neoni.net)
  • Build Date: 19 May 2015
  • Requirements: Symphony 2.4.x or greater.
  • Text visible on screenshots was rendered with Lobster font (http://www.impallari.com/lobster/) created by Pablo Impallari.

Installation

  1. Check if /symphony/workspace/text-formatters exists and is writable by Symphony.
  2. Upload the templatedtextformatters folder in this archive to your Symphony extensions folder.
  3. Enable it by selecting the "Templated Text Formatters" on System/Extensions page, choose Enable from the with-selected menu, then click Apply.
  4. Go to Blueprints/Templated Text Formatters and create new text formatters.

Changelog

  • 1.11 Updated Markdown template to support latest "Markdown" and "Markdown Typography" extensions.
  • 1.10.1 Bugfixes for Symphony 2.4. This drops compatibility with Symphony 2.3.x.
  • 1.10 Update for Symphony 2.5.
  • 1.9 Update for Symphony 2.3.3. This may break compatibility with Symphony 2.3. Updated Markdown template.
  • 1.8 Update for Symphony 2.3. This drops compatibility with Symphony 2.2. Removed Makrell formatter (Makrell project is dead). Fixed a bug in XSLT template (error when there was no utility found).
  • 1.7 New template: XSLT.
  • 1.6 Update for Symphony 2.2, fixed few bugs, updated Markdown template, added new template: Makrell, changed this README to Markdown syntax.
  • 1.5 Update for Symphony 2.0.3. This drops compatibility with Symphony 2.0.2.
  • 1.4 A lot of fixes, support translations, updated Markdown template.
  • 1.3 Fixes and new template: XSS killer.
  • 1.2 Initial release.

Usage

You can create new text formatters by selecting template file and then configuring its options. There is special "chain" formatter, that will allow you to chain text formatters, so they will be used one after another to format text. This can be very useful to extend existing formatters to add own markup and/or handle special characters.

Developers

Developers of text-formatters can make them "template-friendly".

  1. Create 'template' subdirectory in your formatter extension directory.
  2. Create file 'formatter.X.tpl' there. X is the ID of type, try to make it as unique as possible, so no other extensions will clash with it.
  3. Check 'template/formatter.regex.tpl' and 'template/formatter.chain.tpl' (this one is a bit more complicated) templates to see how to create new templates. In short: look for '/* BIG CAPS STRING HERE */' parts which are "placeholders" for PHP code and/or variables. Look for ttf_tokens() function which can return placeholder names and data which should be put in those placeholders. ttf_form() function allows module to add own widgets to text formatter edit page.

Known issues

  1. After changing settings of formatter, you have to save every entry with fields that are formatted by it. Otherwise their data will stay unchanged :(. I don't know how (except for some very ugly hacks) to make textareas and other fields using text-formatters to update their content. Maybe formatted text should be cached with some known hash ID (or by text-formatter id)? That way it would be easy to refresh all content when needed (like: clear cache of every text formatted with X).
  2. I'm not sure about escaping PHP code parts. I tried to make it secure, but... well... backup Your installation before testing this :).

Version history

Requires Symphony 2.4.x

  • Updated Markdown template to support latest "Markdown" and "Markdown Typography" extensions.

Requires Symphony 2.4.x

  • Bugfixes for Symphony 2.4. This drops compatibility with Symphony 2.3.x.

Requires Symphony 2.4.x

  • Update for Symphony 2.5.

Requires Symphony 2.3.3

  • Update for Symphony 2.3.3. This may break compatibility with Symphony 2.3.
  • Updated Markdown template.

Requires Symphony 2.3

  • Update for Symphony 2.3. This drops compatibility with Symphony 2.2.
  • Removed Makrell formatter (Makrell project is dead).
  • Fixed a bug in XSLT template (error when there was no utility found).

Symphony 2.2 to 2.2.x

Added new template: XSLT.

Symphony 2.2 to 2.2.x

  • Update for Symphony 2.2.
  • Fixed few bugs.
  • Updated Markdown template.
  • Added new template: Makrell.
  • Changed README to Markdown syntax.

Symphony 2.0.3 to 2.1.x

Update for Symphony 2.0.3. This drops compatibility with Symphony 2.0.2.

Symphony 2.0.2 only

  • A lot of fixes.
  • Support translations.
  • Updated Markdown template.

Symphony 2.0 to 2.0.2

  • Fixes.
  • Added new template: XSS killer.

Symphony 2.0 to 2.0.2

Initial release.