How to quickly add Google Chrome Frame to your Joomla template Print
September 20, 2011

This tutorial will show you how to quickly and very easily add the Google Chrome Frame meta tag to your Joomla templates with just one line of code.

 

What is the Google Chrome Frame?

Google Chrome Frame is a free plug-in for Internet Explorer. Some advanced web apps use Google Chrome Frame to provide you with additional features and better performance.  You or your visitors will get a faster web experience (sites that utilize GCF become more responsive) and enjoy more advanced features (with GCF, sites offer you new features based on open technologies). Overall it will provide you with a much better Internet experience over standard Internet Explorer.

 

The Problem:

Adding Google Chrome Frame to most websites is pretty straight forward with just a simple meta tag added to the head code but with Joomla the head code is pulled in from a separate core file which shouldn't be edited due to any updates to the platform would break the function of the GCF. So the following is how to add GCF to your index.php file in your template.

 

The Solution:

Open your index.php file from your template's root folder.

Locate the following code: <jdoc:include type="head" />

Create a new line beneath that and add the code:

<?php $this->setMetaData('X-UA-Compatible','chrome=1', true); ?>

(if you are already in php mode then remove the <?php & ?> parts)

 

The above code will now add the GCF meta tag after the head include has been called embedding it into your template's head portion in order to utilize the GCF whenever it is detected.

 

*Note - This will detect the presence of GCF but will not present an error message for outdated versions of IE that do not utilize the GCF. Though I am in the process of making a tool for such detection/presentation.

blog comments powered by Disqus