EasyCode Include LogoVersion: 1.2.0

EasyCode Include is a simple Joomla! 3.x (and 2.5) content plugin that imports a raw source code file and inserts it inline in your articles or anywhere else a content plugin will work.

EasyCode Include was previously called EasyGitHub Include… but it works everywhere so we renamed it!

EasyCode Include loads the code file from a local webserver path or a website URL (e.g. from GitHub or any other URL that links to a raw code file) and applies Google Prettify syntax highlighting.

Free Download

  • About...
  • Installation
  • Configuration
  • Changelog

Using EasyCode Include


The image below shows the formatted output of a section of a PHP file included from a GitHub Repository. You can see this example and others on our demo site or you can click on the image to see a larger version.

Default Include Example PHPDefault Include Example PHP 

It's not a Git Only World

In this example we're actually using a code file hosted on Google's Code repository - really it doesn't matter where the file is hosted as long as the URL you give the plugin returns just the code file. If the URL returns a HTML page with the code inside it the HTML will be formatted and presented in the page as well.


Please note in the examples shown below the space between the { the plugins identifier i.e. easycodeinc 

{ easycodeinc URL, THEMEX, LANG, LINENUMS:Y}

The most common error message you will receive is that the URL is incorrect, more specifically it will look like this:

Sorry cURL failed to retreive the page, is the URL correct?.


{ easycodeinc https://raw.github.com/user/project/branch/filename.suffix, 2, php}


{ easycodeinc https://raw.github.com/user/project/branch/filename.suffix, 2, php, linenums:20}


{ easycodeinc https://raw.github.com/user/project/branch/filename.suffix, , , linenums:12}


URL- The URL should point to the raw code file and be of the form


If the URL doesn't start with http but does start with a leading slash /  then EasyCode Include will attempt to load a local file relative to the root of the website. The example below will load a file in the /images/code_samples/ directory.

{ easycodeinc /images/code_samples/skynet.c}

THEME X - This is an optional parameter, if its not provided the setting in the plugin will be used. If it is provided it must be from 0 to 3 where X is one of the following:

0 - i.e. 0 = Default Theme
1 - i.e. 1 = Desert
2 - i.e. 2 = Sunburst
3 - i.e. 3 = Sons Of Obsidian
4 - i.e. 4 = Doxy

If you use multiple code blocks on a single page only the theme of the first code block will be used.

LANG - This is an optional parameter, if its not provided the file suffix from the URL will be used. If it is provided it overrides the URL's file suffix.

LINENUMS:Y - This is an optional parameter, if its provided Prettify will add line numbers to every 5th line. You can specify a starting line by using linenums:y where y is the first line number.

RANGE X-Y - This is an optional parameter, if its provided EasyCode Include will only display lines X through Y of the file. You must specify both a starting line and an end line number e.g. 20-30 where 20 is the first line number and 30 the last.


EasyCode Include is made possible by Google Code Prettify

EasyCode Include is a standard Joomla! plugin and is installed using the Extension Manager.

After installation you should see an installation was successful message.

You can configure the EasyCode Include plugins default values from the Plugin Manager as you would with any other Joomla! plugin. Don't worry we've put all the syntax tips in the plugin's Description view and we've added useful tooltips to all of the settings.


Plugin SettingsPlugin Settings

Use Google?

The Use Google option is a new feature in version 1.1.0 and allows you to use the Prettify files on Googles servers, which most time will be faster than using your own servers. Please note at the time of this writing note all languages supported by EasyCode Include are available In the CDN version, if you need a language style that isn't on the plugin try setting this option to NO to see if the plugin has it.

Include Prettify Javascript

If you're not using Googles servers, this option allows you to prevent the inclusion of the Prettify.js files (if for example you're already including them through another means).

Include Prettify CSS

If you're not using Googles servers, this option allows you to prevent the inclusion of the Prettify.css files (if for example you're already including them in your template CSS).

Code File Wrapper

The raw code file is wrapped in a set of tags with the options being:

  1. <code> tags for HTML5 templates
  2. <code> tags inside <pre> tags for non-HTML5 templates
  3. <pre> only tags for old templates and browsers

If you're using a pure HTML5 template you will want to change this setting from the default to "Wrap in <code> tags".

Prettify Theme

Allows you to set a default theme to be used when one isn't specified in the tags you embed in your article.

Force Cache?

The one setting you may be tempted to play with is the "Force Cache" setting. Simply put as the plugin runs on your webserver it has to first retreive the contents of the URL from another server, sometimes on less expensive hosting services this can take several seconds, which your end user will see as being a slow page load from your website.

To avoid this issue the Joomla! cache is, by default, used even if you have Joomla!'s Global Cache setting turned off. To make the plugin obey your Joomla! settings simply set "Force Cahce?" to "No". Of, course this means if you have the cache turned off globally then your end users will see a pause on evey page that uses the plugin.

The cache is relatively smart, in that we cache the retrieved code file against a hash of it source URL, so even if the source file is used in multiple articles in your website it will only be retreived once during each cache cycle.

If you are loading your code file from the local webserver (i.e. somewhere inside your website root directory) then you can set this to "No" with minimal performance impact.



  • Added support for loading local files
  • Validated for Joomla 3.4+
  • Renamed to better reflect general functionality
  • Updated to latest version of Prettify.
  • Updated to new Google CDN URL.



  • Add support for new theme. Add support for using Google servers.
  • Upgrade Prettify to 4 March 2013 release.



  • Add support for showing subset of a file (i.e. a range of lines)
  • Apply coding standards.



  • Added missing index.html for JED
  • Handle CSS loading sensibly.
  • Change URL retrieval to make sure checking is down first.
  • Load language file.
  • Only modify $article if we have some output.
  • Change wrapper default to most common requirement.
  • Update XML to include `language` folder and `prettify` folder.
  • Move language files to J25 location.



  • Initial commit.



Free Download

You need to login to access the forums.

Member Login

You need to Login to access your Subscription details or the Forums.