Using Markdown inside a UDT

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
gsalmeri

Using Markdown inside a UDT

Post 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!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Using Markdown inside a UDT

Post by calguy1000 »

in your UDT, you can echo markdown syntax like:
echo "### heading"
then in your template or page, try {udt_name|markdown}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
gsalmeri

Re: Using Markdown inside a UDT

Post 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...
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Using Markdown inside a UDT

Post by calguy1000 »

I will test it out, it should work.... remind me tonite or tomorrow.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
gsalmeri

Re: Using Markdown inside a UDT

Post by gsalmeri »

Sorry, I couldn't access the Internet in the past days. Have you found anything useful? Thank you very much!
Locked

Return to “Modules/Add-Ons”