Page 1 of 1

Using Markdown inside a UDT

Posted: Sun Apr 29, 2007 5:08 pm
by gsalmeri
I have installed the Markdown module (1.2) and all works perfectly. Now I would like to use the Markdown syntax also, in certain circumstances, *inside* a UDT. For example, instead of writing in a UDT:

Code: Select all

echo 'This word is <em>emphasized</em>!';
I would like to write something like:

Code: Select all

echo Markdown('This word is _emphasized_!');
Is that possible? (More exactly, I need a UDT that reads an external file in Markdown syntax and outputs it in a page, but I suppose this is conceptually identical with the above trivial example.) I have browsed the documentation, and also the source code of the Markdown module: perhaps I need to have access to the function ContentPreCompile, but I know too little the internals of CMSMS... Can anyone help me to find the solution? Thank you very much in advance!

Re: Using Markdown inside a UDT

Posted: Mon Apr 30, 2007 12:22 am
by calguy1000
in your UDT, you can echo markdown syntax like:
echo "### heading"
then in your template or page, try {udt_name|markdown}

Re: Using Markdown inside a UDT

Posted: Tue May 01, 2007 7:08 am
by gsalmeri
Unfortunately it doesn't seem to work. I have also browsed the documentation for Smarty, but I didn't yet find a way to obtain what I need. In this forum I have found an old thread that perhaps is useful: http://forum.cmsmadesimple.org/index.php/topic,787.msg3972.html. I will try...

Re: Using Markdown inside a UDT

Posted: Tue May 01, 2007 2:19 pm
by calguy1000
I will test it out, it should work.... remind me tonite or tomorrow.

Re: Using Markdown inside a UDT

Posted: Mon May 07, 2007 7:33 pm
by gsalmeri
Sorry, I couldn't access the Internet in the past days. Have you found anything useful? Thank you very much!