This is an old revision of the document!
If you are building a site from scratch, converting an existing site to GetSimple or you have a web page you want to use as a template you need to create a GetSimple Theme. There is a Step-by-Step Tutorial for converting a static html template into a simple theme.
Creating themes for GetSimple is extremely easy. GS uses template tags similar to WordPress (if you are familiar with that). All template pages are written in PHP. There is only one truly required theme file, and that's template.php
. You then place that file within it's own unique folder name, and install it on your server.
template.php
is the “Default Template” file used for most pages within your site, but you can make other files within your theme and set particular pages to use that new template file instead by choosing it within the Page Options → Template setting:
At the very minimum, a GetSimple theme consists of only one file: template.php
. This file should reside inside a folder named specifically for your theme, and placed within the theme folder of your GetSimple installation such as: /path/to/getsimple/theme/my_theme/template.php
You can rename a theme by renaming the folder that contains it.
By default all new pages use the template.php
file when displayed. Developers have the ability to create other non-standard template files such as homepage.php
or contact.php
. The user of the cms would then choose that particular template when creating a new page.
A file named editor.css
in the theme folder will enable the CKeditor to display page content more accurately.
Как только вы сверстали сайт и закончили его стилевое оформление, наступает время применить тэги шаблона для формирования страниц вашего сайта с помощью GetSimple.
Напрмер, если вы хотите показать ссылку на страницу и контент страницы, вставьте в файл шаблона следующий код:
<a href="<?php get_page_url(); ?>"><?php get_page_title(); ?></a> <?php get_page_content(); ?>
А теперь - несколько советов для разработчиков тем для GetSimple
/Путь_к_GetSimple/gsconfig.php
. Внимательно изучите этот файл. Настройки касаются редактора CKEditor, загрузки файлов на сайт, безопасности, языка и генерации файла sitemap.xml/Путь_к_GetSimple/gsconfig.php
, для отображения всех ошибок PHP.Путь_к_GetSimple/data/other/logs/errorlog.txt
. Ошибки в системном логе регистрируются вне зависимости от значения настройки GSDEBUG./Путь_к_GetSimple/theme/Наименование_вашей_темы/functions.php
./Путь_к_GetSimple/theme/your-theme/images/screenshot.png
. Этот рисунок будет отображаться в панели управления при активации темы.screenshot.png
, только в нижнем регистре и должен находиться в папке /images/
темы. Только при этих условиях он будет обнаружен и показан системой.<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); } ?>