17. January '09, 14:08

sol-Geshi for Joomla

ABOUT GESHI & JOOMLA PLUGIN

Geshi is a generic Syntax Highlighter. If you are not familiar with it you could find more information on the Geshi Webpage:
http://qbnz.com/highlighter/

This Plugin give you some simple options to include a file from a specified directory into your content as a highlighted Syntax.
This is usefull for e.g. programmers to show codeparts or examples without needing them to write down in the WYSIWYG Editor of Joomla. I often had big difficulties embedding several codes directly in the article, time to time it cause to break my webpage design or simply broken the code itself. So this Plugin just use a very simple code which is fulle WYSIWYG Editor compatible.

PRE-REQUIREMENT

You need to create a directory on your webserver where you place the codefiles you wish to include into your content. To ensure nobody from the outside can access this codefiles directly I suggest to also place a .htaccess file into this dir. For Example I use a .htaccess file with this content on my /codefault/ directory:

# deny web access
Options -Indexes
Order Allow,Deny
Deny from all

SETTINGS

On the right side you could see a Screenshot of the Adminsettings. You simple can enable or disable / change some geshi options without hacking in the code.

INSTALLATION

sol geshi sol Geshi for Joomla joomla

Install this Plugin in Joomla, Activate it in the Pluginmanager.
There are some configuration options available.

USAGE

For example if you want to show a PHP code file within your content upload it to the in PRE-REQUIREMENT created directory. e.g. myscript.php then edit the content where you want it to be displayed and enter this:
[geshi:myscript.php]
if you now save & view your content on the page it should display the content of myscript.php highlighted as php.
Geshi is outmaticaly determining the code language by the extension of the file.

NEW GESHI

The joomla embedded Geshi isn’t always the newest version so I decided to rather use a external SVN Export of the current Geshi Version. You can download the latest geshi package from the geshi webpage and place it in a directory in your joomla. e.g. I extracted it into the /includes/ folder. After this you can change the path within the plugin settings page.

EXAMPLE CODE

< ?
$test = rand(1,99999);
echo "This is just a random test snippet... ";
echo $test;
?>

DOWNLOAD

  • sol Geshi for Joomla, ver. 090117,
  • Related Posts

    • No Related Post

     

    Der Artikel hat dir gefallen oder war hilfreich ?

    Wenn dir dieser Artikel gefallen hat kannst Du nun einen Kommentar verfassen oder einen trackback senden. Über eine Share/Bookmark Verlinkung oder Empfehlung würde ich mich freuen. Als Alternative zum Lesen im Blog steht auch noch ein RSS Icon RSS Full-Feed zur Verfügung sowie die Möglichkeit Blog Postings via E-Mail zu abonnieren.


    Leave a Reply

    XHTML: allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <p> <q cite=""> <strike> <strong>

    AVATARS: To set a Picture / Avatar please check out Gravatar.

    Spam protection by WP Captcha-Free