Currency Converter

  • Currency
  • US$ Amount

Template zone points system

Dimofinf offers you a professional and simple system for the template zone. The template zone is a set of points centers which are planted and distributed among the blocks files whether for Dimofinf or your programming allowing you or other programmers to add your own blocks and display them in these points. This permits the programmer to add his own blocks without needing to alter the source files for the main block. The following are some points you need to bear in mind with regards to the template zone in Dimofinf:

  • The hook points are stored in an xml file. As in Dimofinf, the hook points file is found in the path 'include/xml' under the name 'template_zones.xml' but in the plugins it is found in the path 'include/pluginfolder/xml/pluginfolder-template_zones.xml' replacing 'pluginfolder' with the plugins folder name.

(Important note: template zone files must be stored in the same name form in the plugins)

An example for the xml file for the points of the template zone:

<?xml version="1.0" encoding="UTF-8"?>
// template zone points groups 
	<zonemodule module="zonegroup">


  • Template zone points are classified into groups and each group has its own points.
  • The feature 'module' in the 'zonemodule' tag is the name of the template zone points group.
  • The 'zone' tag includes the name of the template zone point. 


      Planting a template zone point in a place within the block file:

You can plant a template zone focal point in the block file anywhere you want, in order to make it available to call this point noting that this point must be predefined in the template zone file for the plugin.

{* php buffer start *} [INCLUDEZONE BLOCK zonepoint
{* php buffer end *}

This tag is added within the block file wherever you want, replacing 'zonepoint' with the name of your zone point since the block system, while processing the block, will call all sent blocks to this point to merge it with the block being processed and display them within the block.

      Sending a block to a template zone point:

Through your plugin, you can send your block to the template zone point by calling the function 'add_template_zone()' and adding it to the function, then sending this function to the hook point using the function 'add_hook()'


In the function file of the plugin found in this path 'include/plugins/pluginfolder/pluginfolder_plugin.php', replacing 'pluginfolder' with the name of the plugins folder.

Add the function 'add_template_hook()' in a function, then the function 'add_hook()' is used to send it to the hook point. The function 'add_template_hook()' accepts three variables:

  • The first variable (mandatory): carries the path of the block file you want to send without adding the block file extension, the path is the plugins folder name then the 'tpl' folder of the plugin blocks then the block name.
  • The second variable (mandatory): the name of the template zone point you are sending to.
  • The third variable (mandatory): 'true/false' value and is assigned to 'true' if the path of the sent block is outside the plugins folder 'include/plugins'.

{* php buffer start *} function function_name(){
{* php buffer end *}

  • Several blocks can be sent to several template zone points as a single batch using the function 'add_template_hook' directly without needing to call it once for each block you want to send and its value is the name of the template zone point it is sent to.

{* php buffer start *} add_template_hook(array(
'pluginfolder/tpl/template1' => 'zonepoint1',
'pluginfolder/tpl/template2' => 'zonepoint2'
{* php buffer end *}

Note: replace the 'pluginfolder' with the name of the plugins folder, 'templatefile' with the block file name, 'zonepoint' with the name of the zone point you are sending the block to, 'hook_point' with the name of the hook point you are sending the function that carries the function 'add_template_hook()' and 'function_name' with the name of the function that carries the function 'add_template_hook()'.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article