Textile support

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
pshouse
New Member
New Member
Posts: 6
Joined: Sun Dec 16, 2007 11:38 am
Location: Bari, Italy

Textile support

Post by pshouse »

I'd like textile support for CMSMS. Perhaps in the same flavour as MarkDown support:
{cms_textile} {/cms_textile} {content|textile}

Where do I start developing? :-)
Where do I start learning how to code in this support?
Or are there developers interested in doing this job?
Last edited by pshouse on Sun Dec 16, 2007 11:52 pm, edited 1 time in total.
pshouse
New Member
New Member
Posts: 6
Joined: Sun Dec 16, 2007 11:38 am
Location: Bari, Italy

Re: Textile support

Post by pshouse »

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 :-)
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by pshouse on Sun Dec 16, 2007 11:55 pm, edited 1 time in total.
cyberman

Re: Textile support

Post by cyberman »

Many thanks for providing this useful information :)!
pshouse
New Member
New Member
Posts: 6
Joined: Sun Dec 16, 2007 11:38 am
Location: Bari, Italy

Re: Textile support

Post by pshouse »

Many thanks to dev team for providing such a nice CMS :-)
I felt in love with it immediately. If a feature is not there, you just code it in.
No other CMS lets you do it as quickly. Maybe this is "the programmers-friendly cms".

I'll tell textile team to add smarty interface (if they wish) to their php (so when upgrading, you don't have to rewrite it) :-)
And I'm telling to core dev team of cmsms to add textile support (i.e. include the two files above in distribution) as they did for markdown, if they wish. :-)

I'd like a lot, of course :-)
appleyard
Forum Members
Forum Members
Posts: 27
Joined: Wed Dec 30, 2009 2:54 pm

Re: Textile support

Post by appleyard »

I agree with the above: Textile on CMSMS is awesome!

However, for some reason Textile is not rendering in my News module summary templates. (Detail templates render as expected.) I posted about it here: http://forum.cmsmadesimple.org/index.ph ... 807.0.html

Anyone have a solution?
Locked

Return to “Modules/Add-Ons”