Search

A new Extension, “Templated Text Formatters” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

While working on some text-formatter i decided that i don't want to copy whole Markdown just to add some additional syntax to it. So i created this module.

Functionality

  1. You can chain various text formatters into one (new/additional) text formatter and then use it like regular formatters.

  2. You can create own text formatters based on regular expressions.

  3. If You created text formatter extension, You can turn it into template (look into existing templates included in this extension) to make additional options available to users.

Known issues

  1. After You change settings of formatter, You have to save every entry which uses it, before data is changed :(. 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. There is no recursion detection! So be careful before You start chaining chained formatters :).

  3. I'm not sure about escaping PHP code parts. I tried to make it secure, but... well... backup Your installation before testing this :).

I hope You'll find it useful and non destructive ;).

2009-03-19: version 1.4, requires Symphony 2.0.2+ and Markdown extension updated to version from 2009-03-14 at minimum.

Download

upload it to imageshack.us :)

I'm really interested in this one :D

Must be a bug in Vanilla...

Can you please email the extension to us please? We'll put it up for you. Email it to team at symphony21

Mail sent :).

Thanks!

I linked temporary download for those who want to test it as soon as possible (please let me know about results :).

I had difficulty uploading something using Firefox awhile back and it ended up being my Internet security software.

I had difficulty uploading something using Firefox awhile back and it ended up being my Internet security software.

Yeah, but i don't use such software here. Also i don't have problems when uploading files in other places (gmail, drupal, etc...) so i doubt it's something wrong here.

What's even more strange is that i uploaded ZIP file on bugs page (session handling stuff) without any problem :).

Allen, i just got e-mail message delivery failure:

Technical details of temporary failure:
TEMP_FAILURE: The recipient server did not accept our requests to connect. Learn more at http://mail.google.com/support/bin/answer.py?answer=7720
[mail.symphony21.com. (10): Connection timed out]

Maybe it's something with Your server/domain setup? There was no problems with other mails i sent at that time.

Dang, you're right. There was a misconfiguration with the DNS records. It'll take a couple hours to resolve, so in the meantime, you can email team[at]21degrees[dot]com[dot]au instead.

Thanks Alistair. I still can't upload files from Firefox, but maybe it's just my DNS not updated yet.

BTW i just finished creating template for Your Markdown text-formatter :). It allows user to enable/disable Extra and SmartyPants. Unfortunately using MarkdownExtra for one field and Markdown for other field doesn't work because of function and variable names clashing.

I also updated this extension to fix tiny bugs :).

I would like some examples of interetsing uses for it. Wrapping text blocks in divs, structural things like that? because markdown extra has pretty much all inline stuff covered?

newnomad, i think that structural changes should be done with XSLT (that's one of the main advantages of Symphony :).

Unless You want to strip some tags before data is saved to database, e.g., remove all img tags, in which case You could chain markdown with regexp filter. Still, it's probably better to remove img tags with XSLT, so You can keep all data in database, and filter it however You want when page is rendered.

Better use would be maybe for automatic linking or changing of selected words, e.g., link every "symphony" word to this forum or wrap every censored word with span and then change it with XSLT depending on user ;). That also can be done in XSLT, but string manipulations are probably faster in PHP (and easier to do with regexp, than XSLT).

I think that main usage for it is chain formatter, because different specific usage cases can be implemented as separate formatter modules, and then chained. 2nd good usage is to create template for formatters which could handle more options, but there are none implemented in original extension.

Regexp formatter seemed like a cool thing, but it's not that useful in many situations :).

FYI:

Templated text formatters chaining only works (when the markdown extension has been freshly enabled after the Templated text formatters extension has, and) after (2 different) custom markdowns and the to be chained formatter has been created.

bit buggy...

newnomad, thanks. I should move markdown template to submodule, because it requires markdown formatter to be enabled. Or simply separate it as another extension. Or ask Markdown extension developer to include this template? :).

Version 1.4:

  • Requires Symphony 2.0.2 or later
  • Requires updated Markdown extension (at least version from 2009-03-14)
  • Includes some bug fixes and update for previously generated text formatters.
  • Thanks to updated Markdown, You can have different Markdown formatters selected for different fields of the same section. With old Markdown library first field decided what formatting options will next fields use.

Be sure to backup text formatters before installing new version of this extension (just in case something goes wrong).

Templated Text Formatters updated to version 1.7 on 5th of June 2011

  • Symphony 2.2.x is now required,
  • new templates: Makrell and XSLT,
  • lots of fixes,
  • simplified templates, so it is easier to create new ones.

Templated Text Formatters updated to version 1.8 on 27th of June 2012

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details