Unlike previous versions of Olate Download v2.x, version 3.x comes fully equiped with a template system which allows you to customise your site exactly how you want it. The template files are plain HTML, and therefore an understanding of HTML is needed. There are also other special tags which are parsed by the template engine to insert the data.
To make a new theme, follow the steps below. Alternatively, download templates created by other users in the Olate forums.
If you like the default Olate theme, but would like to change the colours and logo to suit your design, you can edit the CSS file which is located at global/core.css. To change the logo, simply replace the following file with your own logo: images/logo.gif
Variables are used to insert dynamic data from Olate Download - the name of a file, for example.
They have a very simple syntax: {$variable_name}
There are a number of variables that are available in any template, these are:
Language variables can change depending on the language file that is currently being used.
{lang:section_name:variable_name}
For instance, if {lang:general:title} was put in a template, it would use the following variable in the language file:
$language['text']['general']['title']
You can place {$pagination} on the page in certain files to display the pagination there. This allows you to move it about to suit your own design.
This variable is available in the following fields:
Blocks can be used to create repeating sections of a template easily and quickly.
The syntax is:
{block:block_name} Hello {$name}!<br />'' {/block:block_name}
To parse this, you could use something similar to this:
<?php $names = array('Matt', 'David'); foreach (s $names as $name){ $template->assign_var('name', $name); $template->use_block('block_name'); } ?>
Which would show the following:
Matt
David
Conditionals are a very useful part of the template engine, and enable you to show a different page depending on the value of a certain condition. If you are familiar with programming languages, then you will know what conditionals are, and the OD3 template engine supports the following features:
Conditional statements can use any variables that are available to the template, and certain functions (isset(), empty()) in the condition. Here are some examples:
{if:$global_vars[version]=='3.0.0 Beta 1'} You are using an old version! {elseif:empty($name)} Who are you? {else} What do we do now? {endif}
Olate Download 3 includes a full language system which allows you to create your own language files. The default language is English (British).
Many users have already contributed and provided their translated language files. These can be found at http://www.olate.co.uk/od3/download.php.
The language file is located in upload/languages/english.php. Within this file, you will find all of the text used within Olate Download 3. You should rename this file to the name of your new translation.
Lines 20 to 28 are basic configuration options to allow you to change the name of the language and add your name, e-mail address and web address. You should also define which Olate Downlad version the language file is for as well as the date you finished the translation.
Note: The short_name variable must be the same as the filename.
The actual translation is simply a matter of replacing the english text on the right side with the translated version.
Once you are done, you can select the new language from the General Settings option of the Admin Control Panel.
Please consider releasing the file to other users to download and use - e-mail it to us and we will announce it and offer it for download and can mention your website in a credit line!