Smarty Markdown modifier

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
evets

Smarty Markdown modifier

Post by evets »

I installed Markdown as a Smarty modifier. 

The only way I could find to use it (in a template) was to capture the content and pass it to the modifier.

Code: Select all

{capture name=stuff}{content}{/capture}{$smarty.capture.stuff|markdown}
Any other ideas?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Smarty Markdown modifier

Post by Ted »

A nice way to do it would be to make it a module (using the actual markdown code) and hook it into the ContentData function.  This way you could pass content through Markdown when it's pulled from the database, but before it's pasted into the template.  Caching would work correctly also.

Writing modules is covered here: http://wiki.cmsmadesimple.org/tiki-inde ... ing+Smarty and http://wiki.cmsmadesimple.org/tiki-inde ... _ref_id=16 or you can always get ahold of us on IRC if you have questions.
Locked

Return to “CMSMS Core”