Displaying Joomla and other code inside an article

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!

Exceptions: (a) Images from content providers other than ourselves used on this website under Creative Commons Licenses (such as images found on the blog) will require notification to or permission from their owners if you wish to use them. We have notified those providers and/or obtained their permission, and the details are indicated beneath each image where used. (b) Content contained in any external links found on this site.