Typically, sites do not use the original CMS to the original design. Webmasters integrate their design templates, make improvements in their codes of modules files (we call it the "customization"). The webmaster can very long process DIAFAN.CMS, changing modules "under him", affecting a lot of system files in different folders.
For the convenience of ordering and administration of such changes in DIAFAN.CMS exist Design and themes.
Theme may be required to:
Example:
Webmaster previously made changes in the subject, and / or apply updates. As a result, the site several themes, one of which is currently used. For example, this current theme is "mytheme", respectively its files are stored in the folder custom/mytheme.If the webmaster of the need to correct the appearance of the news list, you must edit the file custom/mytheme/modules/news/views/news.view.list.php. Changes are displayed on the site, because it is the current theme.
A common mistake that webmasters make, forgetting that they have applied the theme. Instead of the current theme file rule "deceptively similar" source file system modules/news/views/news.view.list.php. All changes in this file will not be displayed on the site, because the display priority have similar files in the folder of the current theme custom/mytheme.
So, if you come across the fact that changes in theme files are not displayed on the site – check what topic you are editing your current or base "from the box."
You can also apply directly nesolko topics. Then they will isopolzovatsya on the site during the installation procedure. The priority will be the last installation. In the list of the themes applied are displayed above the rest, in the order of application. First, those that were used before. Then those used later.
Example:
On the site are two themes used. First theme is my, then theme my1. Both themes have a file modules/news/news.php . The site will be used file from the folder my1, because this theme is applied later.
If some files are only in the topic my, they will be used.
How many themes can be created for each site?
Plenty. Switch between them very much. You just need to apply the theme and disable the old theme. The most common themes are used for fast design changes, when downloading templates or transfer sites.
How to move a theme from one site to another?
First you need to save all the "custom" file generated by the theme. Then just download the theme file from one site and create a theme on another site, adding the downloaded file in the "Import themes".
Can the theme be empty?
Maybe, though practical sense it does not. If you create a new topic, and anything else it is not done, the theme folder in the folder custom appears, create a theme will be "counted" in the system. Only no effect on the display of the site is, of course, will not. Download a blank subject in a ZIP-archive is also impossible.
Demo content for theme
If you create a template for the add-ons site, you can add them to your theme demo content, which will help better understand the purpose and scope of the template. The oscillator has DIAFAN.CMS demo content. To add the demo content you need:
After that, in your current application will be subject to the installation files of content modules. Content modules will be installed, if you download a theme during installation or reinstallation DIAFAN.CMS module interface "Add / Remove Modules".
Подключаемая часть – файл modules/custom/custom.inc.php. В нем описан класс
Custom_inc. В модуле к объекту класса можно обратиться через переменную $this->diafan->_custom
. Экземпляр класса создается при первом вызове
переменной.
array generate () – Генерирует тему из кастомизированных файлов.
Example:
// generate theme
$result = $this->diafan->_custom->generate();
if(! $result)
{
echo 'The theme is not generated. No customized files.';
}
else
{
if($result["custom"])
{
echo 'Customized files: '.implode(' ',$result["custom"]);
}
if($result["return"])
{
echo 'Recovered files: '.implode(' ', $result["return"]);
}
}
// output: files list
modules/custom/admin/custom.admin.php – Темы;
modules/custom/admin/custom.admin.demo.php – Демо-данные для темы;
modules/custom/admin/js/custom.admin.edit.js – Редактирование темы, JS-сценарий;
modules/custom/admin/js/custom.admin.js – Темы, JS-сценарий;
modules/custom/custom.export.php – Экспорт темы;
modules/custom/custom.inc.php – Подключение модуля;
modules/custom/custom.install.php – Module installation.