Page 1 of 1

Displaying source code as content

Posted: Wed May 28, 2008 10:42 am
by wempy
Hi,
This may be known to everyone apart from me, but as it took me ages to find out I thought I would post it as a tip.
I needed to be able to display some source code (php/c/bash) on my site, but found that a lot of elements in the code clashed with the Smarty engine.
Code between the Smarty tags {literal} {/literal} is not parsed by Smarty so is output normally, and doesn't cause those nasty Smarty compilation errors.
Thanks for a great CMS chaps.  I now have a way of finally inflicting my little programs on the world.
All the best, Wemps.

Re: Displaying source code as content

Posted: Wed May 28, 2008 8:33 pm
by Pierre M.
Thank you. Remember you can contribute to the wiki with your forum account.

Pierre M.

Re: Displaying source code as content

Posted: Wed May 28, 2008 10:37 pm
by calguy1000
also, there's the geshi smartt plugin, that, if installed, and utilized correctly will display your php source code in a funky formatted way.

Re: Displaying source code as content

Posted: Thu May 29, 2008 10:21 am
by wempy
Have added this to the wiki as requested. 
Are there layout rules that I should follow?
It is here http://wiki.cmsmadesimple.org/index.php/How_to_display_souce_code_as_content

Re: Displaying source code as content

Posted: Thu May 29, 2008 1:20 pm
by Pierre M.
Thanks. I don't know about wiki layout. But I suggest you add links to/from existing howto/faq/tips/share pages about the same subject.

Pierre