Is there something in Drupal equivalent to phpBB's [code] tag, that will let you post PHP, C++, Java even HTML code in a story/blogger entry? If I post something to my site with the [

Comments

stodge’s picture

Argh, the post got truncated.

It should finish:

If I post something to my site with the php tag at the beginning it gets removed from the post, as can be seen by my original post!

Thanks

Anonymous’s picture

I'm not sure on C++ and other languages, but I have a little trick for PHP.

Just run this script on you PHP code first. Then copy-paste the generated HTML code into your post, and you have very groovy PHP code.

http://www.ariejan.net/node/view/32

Still, this is a feature request for a next release. Did you make a feature request yet?

Steven’s picture

Project.module has a built-in PHP filter, which you invoke with [?php ?]. You can copy it out into its own module if you want (the _filter hook).

You can use regular HTML <pre></pre> tags for code, but if you want syntax highlighting you'll need a filter.

rapture@coerce.net’s picture

I'm using HTML's textarea tag. Works great for me.