YOOtheme Pro is here! The best WordPress and Joomla theme. Learn more

Customizing Template Presets

This tutorial explains, how you can customize and extend existing presets or create new ones in your Warp 5.5 YOOtheme template.

With presets you can define and load a specific configuration of the template parameters. You can set nearly every parameter of the template via the presets.

Customize existing presets

To customize an existing preset, open the file YOUR_TEMPLATE\presets.php.

All presets of the specific template are listed in this file, each preset should look like this:

$warp->config->addPreset('brownlandscape', 'Brown Landscape', array_merge($default_preset,array(
'color' => 'brown',
'menubar' => 'destructed',
'background' => 'landscape',
'font' => 'georgia'
)));

In this example, the preset defines the color, the menubar, the background and the font of the template, all of these parameters can also be set manually in the template settings.

To have a look at all possible parameters of your template, open the file YOUR_TEMPLATE\templateDetails.xml (if you are customizng a YOOtheme WordPress template, the file is YOUR_TEMPLATE\template.xml).

Here you can see all parameters of the template, e.g. the param for the template background:

<param name="background" type="list" default="default" label="Template Background" description="Background image and font colors">
<option value="none">Plain</option>
<option value="aurora">Aurora</option>
<option value="glitter">Glitter</option>
<option value="bubbles">Bubbles</option>
<option value="landscape">Landscape</option>
<option value="space">Space</option>
<option value="mountains">Mountains</option>
<option value="photo">Photo</option>
</param>

So if you want to change the background setting in the preset we used in our example above, just put another value from the templateDetails.xml in the preset in the presets.php. Let's say, we want to have the bubbles set as background in our preset brownlandscape. Change the code to this one:

$warp->config->addPreset('brownlandscape', 'Brown Landscape', array_merge($default_preset,array(
'color' => 'brown',
'menubar' => 'destructed',
'background' => 'bubbles',
'font' => 'georgia'
)));
The same way you create a new preset. Just copy the whole block of an existing preset in the presets.php and change the values to suit your needs.

Add new parameters to a preset

To add a new parameter to a preset open the file YOUR_TEMPLATE\templateDetails.xml (if you are customizing a YOOtheme WordPress template, the file is YOUR_TEMPLATE\template.xml) and have a look at the different parameters. In my example I want to add a specific template width to a preset. The code for the width is:

<param name="template_width" type="text" size="10" default="860" label="Template Width" description="Set the template width." />

Simply add this parameter to the preset.php. It should look like this:

$warp->config->addPreset('brownlandscape', 'Brown Landscape', array_merge($default_preset,array(
'color' => 'brown',
'menubar' => 'destructed',<
'background' => 'landscape',
'font' => 'georgia',
'template_width' => '1000'
)));
Do not forget to add the "," after the last line, before you add another parameter in a new line.

That's it, you are now able to customize presets or add new ones to your Warp 5.5 YOOtheme template.

Documentation on Github

Help us out! If you are feeling that our documentation has errors or can be improved, fork it at Github and send us a pull request. Any contribution is much appreciated. Thank you!