Skip to content

Creating the skin module

maxmukhin edited this page Aug 2, 2012 · 2 revisions

1. Create the module

Please see Creating LiteCommerce module to get the detailed instruction.

Also you need to choose the skin name. It will be used for naming the directory with templates for future skin. As an example, let it be john.smith.example.

2. Declare the substitutional skin in the Main.php

If there is no init method declaration in Main.php, overriding the parent method, please declare it. Here is the example:

/**
* Method to initialize concrete module instance
*
* @return void
* @access public
* @since  3.0
*/
public static function init()
{
    parent::init();
}

Declare our substitutional skin in this method:

/**
* Method to initialize concrete module instance
*
* @return void
* @access public
* @since  3.0
*/
public static function init()
{
    parent::init();
    \XLite\Core\Layout::getInstance()->addSkin('john.smith.example');
}

3. Create the skin directory

In our example we need to create skins/john.smith.example directory with the en subdirectory in it.

That's all!

The created module holds the new skin. As you can see, the module can include several skins and modifications, not only single skin. Afterwards the module should be enabled in the Admin zone, and the skin directory should be contained with the templates repeating the main skin file structure.

Clone this wiki locally