Joomla! comes with a plugin/mambot called GeSHi that comes in quite handy if you have a site like HowToJoomla.net in which you share code snippets with your readers. I recently tried to use GeSHi on a Joomla! 1.5 site, and I found that it works differently in Joomla! 1.5 than it does in Joomla! 1.0. Read on to see how to use it in both.

What is GeSHi?

GeSHi stands for "Generic Syntax Highlighter", and it is used to highlight code snippets in different web languages like PHP, HTML, and CSS. It also converts tags in those languages so that they will not render like regular tags.

For example, if you want to share some HTML code, you have to use something like GeSHi, or the browser will treat your HTML code like regular HTML code.

The following code is done without GeSHi:

Without GeSHi

The following code is done with GeSHi:

With GeSHi

Not that in the code with GeSHi, you can see the HTML tags, and in the code without GeSHi, you cannot see the HTML tags. The words "Without GeSHi" are rendered like regular HTML

How to use GeSHi in Joomla! 1.0

To use GeSHi in Joomla! 1.0, you use the following HTML code:

 

You can change 'lang="html"' to other languages like 'lang="php"' so that GeSHi highlights it according to the language you are using.

How to use GeSHi in Joomla! 1.5

GeSHi has a very slight difference in Joomla! 1.5. Here is an example:

 

 

Note that instead of 'lang="html"', you use 'xml:html'. That is the only difference. I'm not sure why they did it that way, but they did so if yo plan on using GeSHi for Joomla! 1.5, you need to be aware of this.

Questions/Comments

As always, questions and comments are welcome.

Login to post comments

advertise with us

Boost your traffic and expand your pool of potential customers

8000 active members

Ready to join Now?

CMS Portal - The free marketplace for submitting Joomla, Drupal, Wordpress, Magento, phpBB, Prestashop, vBulletin, Opencart Templates and more.

FOLLOW US

Email Newsletters

Make sure you don't miss interesting happenings by joining our newsletter program.
konya escort eskisehir escort canakkale escort samsun escort balikesir escort aydin escort hatay escort kahramanmaras escort giresun escort tokat escort
Joomla Templates Free Joomla Templates Virtuemart Templates K2 Templates JoomShopping Templates HikaShop Templates SobiPro Templates OpenCart Themes
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes
bettilt
tempobet