Urdu English
English English Deutsch Deutsch Español Español Français Français Italiano Italiano Nederlands Nederlands Português Português Русский Русский Ελληνικά Ελληνικά
Login



 
Welcome to Jumi! >> Jumi 2.1 Guide   Click to listen highlighted text! Jumi 2.1 Guide

We are introducing Jumi 2.1 beta for Joomla! 1.5 here. There are so many changes in this version!

When 2.1 beta changes into the final release and 2.0 will be marked as depreciated we will incorporate this document into the standard Jumi documentation.

Intro

Jumi plugin syntax has changed (after three years) to different one. There is no backward compatibility in this syntax; however you can use all previous custom codes and features in 2.1 release (and use new ones).

There are not changes in plugin syntax only. Changes are elsewhere. So read the document carefully, please.

For those who are too eager to try new version or hate to read "all that stuff" here is the Quick & Dirty plugin syntax change:

Old Jumi plugin syntax

{jumi [stored_code_source] [arg1] [arg2] ... [argN]}

New Jumi plugin syntax

{jumi stored_code_source}written_code{/jumi}

How to make transition to Jumi 2.1 syntax? We will explain it below. But first things first.

Let's start with some overall Jumi extensions explanation then we will continue with how to upgrade and install. At the end you will get good knowledge about "all that stuff".

The set of Jumi extensions

Jumi 2.1 consists of several interdependent extensions:

  • Jumi system plugin (Totally rewritten!)
    enables to include custom codes from several resources into Joomla! articles, content and category descriptions.
    It sets up Jumi Root for Jumi component and Jumi module. Codes are processed in PDF version of Joomla! content and stripped out from RSS.
  • Jumi editor-xtd (New!)
    is an Joomla! editor button that enables to code/decode scripts for their direct inclusion into Joomla! content and further processing by Jumi system plugin.
  • Jumi component (+ shared Jumi Root usage)
    creates custom Joomla! pages (so called Jumi Applications) containing custom code.
  • Jumi SEF router
    is a system plugin that supports Jumi component: It enables direct accessing of Jumi application with it's alias (e.g. http://www.mysite.com/hello-jumi).
  • Jumi module ( + Debug mode, + Shared Jumi Root usage)
    is simple module that enables to include custom codes from several resources into Joomla! module positions.
  • Languages
    except Jumi router plugin there are language files for all Jumi extensions for their easy translations.

Jumi 2.1 requirements

Nothing less then Joomla! 1.5.8 is required.

Upgrade from previous versions

We recommend to completely uninstall all previous Jumi extensions and install the Jumi 2.1 package. Consider following:

If you want to use your old Jumi component database table in new Jumi 2.1 then back it up first by the database tool you are using (e.g. phpMyAdmin). After installation of new package you restore the original Jumi Component database table.

The old Jumi plugin syntax will not be processed by the new plugin. You will have to rewrite every old plugin syntax instance. We are very sorry for the inconvenience it will bring you. On the other hand it will bring you more possibilities, better security and more flexibility. Something for something.

Also remeber that all Jumi modules will be destroyed during the process of uninstallation. So we recommend to make a note of all Jumi modules content at the least.

Jumi 2.1 installation

Install the pack as a standard Joomla! extension. All Jumi extensions are installed during this one-click process. All Jumi plugins are set to "Enable" too.

In Jumi 2.1 there is no demo main menu "Hello Jumi!" item visible in the frontend as it was in Jumi 2.0. Some of our users hate it even as a demo. If you want it you have to make it visible manually: go to the backend and publish the preinstalled menu item "Hello Jumi!" there.

Next steps

Using Jumi component, module and router could be deduced from previous releases or documentation or this cheatsheet.Jumi 2.1 for J!1.5 cheatsheet

Jumi plugin requires more explanation. Because it uses another tool: Jumi editor-xtd (button) plugin that encodes/decodes custom scripts in a manner they are not stripped out from Joomla! and are processed by Jumi plugin.

In the rest of the article we will explain:

  1. How to write codes into the Joomla! content with Jumi coder (code name for Jumi editor-xtd plugin).
  2. How to edit codes in Joomla! content with Jumi coder.
  3. How to transfer old Jumi plugin syntax to the new one.
  4. Jumi plugin security and other remarks.

Using Jumi coder

Well, see the video first. We will explain it after that.

So how it works?

You know when you include custom script into a Joomla! article the code will be stripped out or, at the best, encoded into html entities.

And here comes Jumi coder. It encodes scripts in a such way that Joomla! and its editor do not recognize it is a code. However Jumi plugin recognize Jumi syntax and everything between Jumi tags.

{jumi stored_code_source}this is a space between tags for your written code{/jumi}

decodes and evaluates. Simple, isn't it?

Jumi Coder help screen

Jumi coder has been tested with nowysiwyg editor, Tiny MCE, JCE and FCK editors successfully. What's great is that you can switch between editors on no editors as you wish. Jumi Coder does not depend on them.

So once again how to include the code into article via Jumi coder? Read and simultaneously consult the image:

  1. Write (or copy from some source) the script into the code editor area.
  2. Realize if you are using Wysiwyg od Nowysiwyg editor. Select encoding accordingly.
  3. Press Encode.
  4. The script is encoded and you will get the encoded result into the encoded code area. (If you had made a mistake or had encoded the script into for another editor type, just press Decode and repeat).
  5. Select the script you see in the encoded code area, copy it into the clipboard (CTRL+C) and paste it (CTRL+V) into Joomla! and between curly Jumi tags.

To be quite sure you understand let's watch another video: how to edit the script that is already in Joomla! with Jumi Coder.

We hope it is clear enough.

So use Jumi Coder for embedding the script into Joomla! and for its editing.

Jumi Coder can be used for embedding script codes into your non Joomla! blog too (like blogger). The code will not be processed but will be visible like code.

Known issue: if the script is "nicely" formatted (multiple lines, tabs, etc.) then nowysiwyg editor breaks this formatting (without the lost of usability - it will work). I (MarHaj) do not know how to deal with it.

In wysiwyg editors nice formatting is preserved.

It's clear that without Jumi plugin (installed and enabled) the script itself will not run! Jumi plugin has to decode it first. Remember: Jumi Coder and Jumi plugin are twins!

Syntax overview

The general Jumi 2.1 plugin syntax is

{jumi stored_code_source}written_code{/jumi}

where

  • stored_code_source is a file (php, css,js, txt, html, ...) pathname to be included in the place plugin syntax or id (proceeded with asterisk) of Jumi component item and
  • written_code is some code. Html, php, js, ot just a text. If php code then it must be wrapped into php start and end tags.

Examples

Example 1: just includes php file

{jumi plugin/system/jumi/jumi_demo.php}{/jumi}

Example 2: including the first record from Jumi Component database table

{jumi *1}{/jumi}

Example 3: includes the first record from Jumi Component databes table which is preceeded (!) by written script.

{jumi *1}<?php echo 'Hello O\'Harra!'; ?>{/jumi}

The precedence of processing written_code -> stored_code_source has got two reasons:

  1. it enables to utilize pre 2.1 Jumi php files that uses Jumi arguments with Jumi 2.1 syntax (we will see later how exactly),
  2. it is compatible with other Jumi extensions (component, module): they have got exactly the same processing precedence.

Multiple lines in written script

You need not write the written script between jumi tags in one line. Multiple lines are allowed. (And combination of script type used as well). For example:

{jumi *1}
<?php
echo 'Hello O\'Harra!';
?>
<div>
<script language="JavaScript" type="text/javascript">
document.write("Your favourite drink?<br />");
function thanks() {
window.alert ("Thank you!") }
</script>
<form>
<select name="qq">
<option>Water</option>
<option>Milk</option>
<option>Bear</option>
<option>Other</option>
</select>
<input type="button" value="show" onClick="thanks()">
</form>
<div>
{/jumi}

Now let's deal with Jumi plugin syntax backward incompatibility.

Old Jumi plugin syntax migration

The old - pre 2.1 Jumi - plugin was utilizing the so called Jumi arguments concept. It could pass arguments (some values) into the included file or included Jumi Component database record item.

In that case the syntax was, as an example, like this one:

{jumi [myfile.php] [edo] [888]}

The argument values (in this case number text "edo" and number 888) was accessible in the php sript (myfile.php) via $jumi[] array. Like this:

<?php
echo $jumi[0].$jumi[1].'@gmail.com';
?>

If your old php scripts utilizes $jumi[] array you need not trash them. Just define the $jumi array in written_code section:

{jumi myfile.php}<?php $jumi= array('edo',888); ?>{/jumi}

And that is why written_code is processed before code stored.

We hope it is clear and this will enable to migrate your old scripts into 2.1 plugin syntax easily.

If you write the scripts from the scratch you can define in written_code any variables which you can use in stored_code_source. For example

{jumi myfile.php}
<?php
$name='edo';
$number=888;
?>
{/jumi}

Remeber: any variable you define outside function or class becomes global variable. It is both good and bad.

It is Good because the variable is accessible from anywhere. It is Bad because it can interract with the variable of the same name that is defined (by another developer) in another place of Joomla! page.

So if you are using your own global variables give them rather exotic names.

New Jumi plugin security issues

If you are using Joomla! as an open environment, that means there are many people who could contribute to the content, the security issues have got their values.

Let's assume for a moment there is a he or she guy who wants to harm or make profit for his own. If the guy is enabled to include the scripts into your website freely and the scripts will be really processed you will not be able to prevent the guy from total controll of your website. Not very enoyable idea, isnt' it?

The old Jumi includes just scripts from a file or from a database. The intruder could use only what have been in your site (and he/she must know the location). But now, when direct script inclusion is possible? It is another cake!

Joomla! developers have introduced blacklist and whitelist filtering concept into Joomla! 1.5.8. You can prevent those who are on blacklist or are not on the whitelist from doing certain "things".

Jumi plugin 2.1 uses this list. If the article author (or group to which belongs) is in the blacklist or is not on the whitelist then Jumi plugin will not processed the code (directly written or included from a file or database) and the code will not be visible in the front end.

Joomla! itselfs strips out the code from articles. Jumi Coder that is available to anyone as a editor button plugin will include encoded script that Joomla! will not clear out. Thye code will be there. But will not be processed! It won't be processed even after Jumi plugin is uninstalled - the script is encoded we repeat.

So if your whitelist/blacklist is set properly, do not be affraid. Just be careful.

Parameter "Jumi Default Absolute Pathname" as you know it from previous releases is still there. Now we are using rather different name for it: Jumi Root.

Jumi Root parameter enables accessing script files easily withoyt writing the full path to them over and over. You can place your script files outside Joomla! root directory too.

Jumi Root was previously set up by each Jumi extension independently. Now there is just one place where you can set it up: Jumi plugin. The setup is valid for all Jumi extension.

So that's all for now

We, developers, Edo an me (MarHaj), will acknowledge any feedback from you, Jumi users. About Jumi itself or this documentation. Something missing? Something unclear? Something does not work as expected?

Thanks for your time in an advance!

Jumi (prefarably positive) feedbacks

Everything else

Click to listen highlighted text!