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! >> Usage for J!1.5   Click to listen highlighted text! Usage for J!1.5

Jumi usage cheetsheet

Jumi Cheatsheet

Jumi - the set of custom code extensions fo Joomla! - comes as a component, plugin and a module.

In this article you will learn how to use them.

Component

The Jumi component creates custom Joomla! pages and includes in it custom codes from a database and/or files.

The component is accessible through admin backend top menu: components -> jumi. It opens Jumi Application Manager.

You will see the list of component applications in the Application Manager. The meaning of the colums in the list and accompanied Application Manager menu is obvious - it respects general Joomla! standards.

There are two preinstalled examples there: "Hello Jumi!" and "Blogspot". From these examples you will learn how to use a component.

The Pathname field should contain references to the files that resides on your server only.

Calling applications

You can call an Application by two ways:

  • relate an Application item with Joomla! menu item or. After the installation of the component there is, as an example for the study, main menu item "Hello Jumi!" connected to the "Hello Jumi!" Application item.
  • write somewhere int the Joomla! content link to the Application item URL adress. The rule for link creation is simple:
    index.php?option=com_jumi&fileid=xxx
    where xxx is ID of Jumi application, that can be seen in the right column of Jumi Application Manager list.

Plugin

The Jumi plugin includes into Joomla! articles custom script: from a file or from Jumi component database record.

Before using the plugin do not forget to enable it in the admin backend.

There is a switch "Hide Jumi code" in the plugin parameters. If switched to Yes it hides all Jumi syntax text in Joomla! articles and stops code inclusions.

Hide Jumi code

Plugin syntax

The general Jumi plugin syntax can be learnt from the Jumi Usage Cheatsheet. We will bring just several examples here:

{jumi [images/codes/test.php]} //includes test.php file located in images/codes
{jumi [*1]} //includes code stored in the 1st record of Jumi component database table
{jumi area calc [test.php] width[4] height[6]} //includes test.php file and fills $jumi array

From given examples you can easily guess that

  1. There must not be any character between the left bracket { and the keyword jumi in the Jumi syntax.
  2. Everything else outside [ ] brackets is stripped out and not processed.
  3. Jumi interprets the conent of the first bracket as the code source and ties to include it. The code source can be either a file or record in Jumi component database.
  4. Beginning from the second bracket [ ] Jumi stores the contents of brackets into $jumi array. The $jumi array (and it values) is accessible from your included php code.

Default Absolute Jumi Path

The Default absolute jumi path is prepanded to the file pathname to be included. If not set it is eqaul to Joomla! root directory. For example:

If we write

{jumi [test.php]}

and the Default Absolute Jumi Path is not set then Jumi plugin looks up test.php in the Joomla! root (where Joomla! configuration.php is). But if we set it to be "images/mycodes" it looks it up in this directory.

We can place our files outside Joomla! installation directory too. For example (on local host) we can have our Joomla! here: "D:/xamp/htdocs/joomla". No problem to store our codes here: "D:/xampp/htdocs/codes" - out of the Joomla! installation directory. The same applies for hosted sites.

The Default Absolute Jumi Paths has got two reasons:

  1. user comfort: no need to over and over again write the full relative path to files to be included
  2. web security: if for certain reasons Jumi is not working the the Jumi syntax code is visible for visitors. Including file path. The Default Absolute Jumi Path is hidden and it is more difficult to gueast from visible code where the code actually is. And if the files for inclusion lies out of your site (www) it is practically impossible to reach them from web browsers.

The Default Absolute Jumi Path set here is the global parameter for all Jumi plugin syntax instancies throughout the whole Joomla!.

Nested replace

Nested replace

Nesting feature interprets Jumi syntax in included code. For example:

Lets have two files: main.php and nested.php.

The file main.php contains

<?php
echo "This is the main file<br />";
echo "{jumi [nested.php]}";
?>

and nested.php contains

<?php
echo "This is the nested script";
?>

Having both files main.php and nested.php uploaded into the server we can write into the article

{jumi [main.php]}

The result we see can be either

This is the main file
{jumi [nested.pgp]}

if the switch Nested replace is set to No or

This is the main file
This is the nested script

in case the switch is set to Yes.

It is clear that Nested replace feature brings for the developers quite interesting possibilities.

The nesting feature works in Jumi plugin only.

The nesting feature works for files and codes stored in the Jumi component database table.

Module

The Jumi module includes into a module position custom script: manually or from a file or from Jumi component database record.

Module parameters

There are just few parameters in the module administration there: "Notepad", "Code written" and "Source of code".

Notepad serves as an area for your notes.

Code written is an area for your code.

Into the field Source of code you can put either a filepathname of the file to be included into a module or *id of the Jumi component Application item.

Advanced parameters

Default Absolute Jumi Path has exactly the same meaning as it has in the plugin. With one slight difference: this parameter is not global for all Jumi modules but it can be unique to each Jumi module instance.

Other advanced parameters - Module Class Suffix, Caching and Cache Time - are general Joomla! parameters that can be found in standard Joomla! modules. I suppose their meaning is clear.

Examples

For quick test the module is working write down into the "Source of code" field *1. Nothing else is required. Then publish the module into any module position available. You should see "Hello Jumi!" demo in the module position (in the frontend).

Click to listen highlighted text!