Textile Module for Xaraya
This is a version of the TextilePHP code wrapped in a Xaraya module format. I put it together ages ago and posted it on my company web site, but as that is going to get a re-design soon I thought I'd also post it up here. What follows is the original text from my previous post and a link to the module.
After feeling a certain amount of frustration with Xaraya's lack of text input modules I decided to experiment with Textile.
John Cox had come up with a port for Markdown which worked nicely as a way of formatting plain text into XHTML. My only problem with it is that it doesn't convert linebreaks (carriage return) into the correct tags unless you use a double space. Paragraphs are picked up however.
So after a bit of trial and error I managed to get the TextilePHP version working with Smartypants within a Xaraya module. I used John's Markdown module and adjusted a couple of bits so that textile.php was used to format text rather than markdown.php.
Now linebreaks are correcly picked up along with paragraphs and formatted into nice clean XHTML.
The download link to the module is at the bottom of the post. Install it as a usual Xaraya module and hook it to Articles. It should then work on all your text. It doesn't seem to pick up other fields like Summary or Dynamic Data so you'll need to specifiy it directly in your templates like this:
#xarModAPIFunc('textile','user','transform',array('extrainfo' => $summary))#
Then where you want your summary to appear you can write:
#$textiled#
You can also tell Xaraya to call transform hooks for summary and titles I believe, in modify config for a particular pubtype.
2 comments
Jump to comment form | comments rssComments
Yes this is really a big help for people like us!
I thank you for sharing this to us.
By the way,I love the design of your website :)
Thanks for this. Big help for me.