Well, it was not that hard, I just coded myself, and works. I followed markdown implementation for guidelines.
1) Download latest textile-php
http://textile.thresholdstate.com/
2) put in /lib/smarty/plugins renamed as modifier.textile.php
3) Add this code inside .php file, anywhere outside class definition (I put it on the beginning of the file)
Code: Select all
# -- Modifier Interface ------------------------------------------------
function smarty_modifier_textile($text) {
$textile = new Textile();
return $textile->TextileThis($text);
}
Then use as MarkDown modifier, i.e. modify your template content tag from {content} to {content|textile}
If you liked {cms_markdown} and {/cms_markdown} blocks, it should be as easy to implement them for textile as well, writing a block.cms_textile.php file in smarty's plugin folder with this content:
Code: Select all
<?php
include_once "modifier.textile.php";
function smarty_block_cms_textile($params, $content, &$smarty)
{
if( isset( $content ) )
{
$textile = new Textile();
return $textile->TextileThis( $content );
}
}
?>
With this approach, you leave templates as they are, and just put to-be-textile'ed text between {cms_textile} and {/cms_textile} tags when editing contents.
P.S.: Good news for lazy people:
just put the two attached files in
lib/smarty/plugins and you're done
