Photo © 2011 J. Ronald Lee, CC Attribution 3.0. Website: jronaldlee.com Flickr: http://www.flickr.com/photos/jronaldlee/

 

We have seen numerous tutorials where the example pseudo-code provided has been rendered by the Joomla! application, making the information useless.  A good example are tutorials explaining the {loadmodule} syntax.  The rendered code usually produces debug errors, an unintended embedding of a module, or the code just disappears!

The easiest method to display code is by using the Display Code Plugin. This extension is still happily working for Joomla 3.0, although, at the time of writing, only Joomla 2.5 is shown to be supported.

 

Configuration

  • After installing the plug-in, you will need to enable it in the Plug-in Manager, and ensure the Ordering is set to 0, i.e. the first place.
    This is because the plug-in needs to run first before any others on the page, otherwise any code will be rendered.

  • Finally, you can place any code inside an article within the {spic}...{/spic} tags and the code will display as it is, without rendering.

 

Usage notes

If you want to format the code, make sure you place the formatting code outside the {spic} tags, otherwise that code too will appear un-rendered!

You can get the full details of this extension on the developers website: http://www.pages-and-items.com/extensions/display-plugin-code

 

Update: 18 November 2014

This module is now fully supported on Joomla 3.3.x