tr | en
6
Jul
2020
Coding a New Module
Category: eIrene CMS
By making use of the eIren einfrastructure, you can rapidly design and develop any web app as an eIree module. In this article we will develop the "Hello World" module in Turkish language.

I will describe how to develop a new wab app as an eIrene module by implementing a simple "Hello World" module in Turkish language.

Visitors of eIrene portal can access its module pages by making use of its name. In this example I will use "merhabadunya" (helloworld in English) as the name of the new module.

When finished, the merhabadunya module main page will be accessed via the URL  "http://eirene_sunucu_adresi/?im=merhabadunya".

merrhabadunya module's UI will be composed of three pages total:

  1. If only the im parameter exists in the URL with the value merhabadunya and there are no other parameters the page will have a heading displaying "Merhaba Dünya!" (which is the Turkish version of "Hello World'" and a link to the second page below.
  2. If there is an additional parameter ip with the value equal to 1 (that is the query part of the URL is "im=merhabadunya&ip=1") then just below the "Merhaba Dünya" heading the IP address of the visitor's computer will be shown.
  3. If the value of the ip parameter is differen than 1 then an error message will be displayed just below the "Merhaba Dunya!" heding.

Module Files:

For any module one should design at least one file as display template in XSLT language and named <module's_name>.xsl.

In our example the name of this template file will be merhabadunya.xsl .

PHP file may be necessery if any script in server side is needed. The name of the PHP file should be in the form <module's_name>.php .

In our example module we need a server side script (function) for finding out the IP address of the visitor. Therefore, we will develop the necessary PHP function inside the file named merhabadunya.php

As soon as we develop and place these two files our new module will be ready to serve page requests.

For the two files (the xslt template and php script file) of the module please use the  "ileri →" link just at the end of the page.

To look at the resulting module's pages at the YÖRENET portal please click here.

 




Add Comment (please login)