How to create a Schlix CMS theme

SCHLIX themes are very easy to construct. In here, we assume that you have a basic understanding of PHP, HTML5 and CSS2/3.

The example template in this tutorial is a very basic to clearly explain the template design concepts. 

1. Structure

Inside your template directory, you should have a minimum of index.php. You can embed the CSS if you’d like.  Let’s suppose there’s a template called “ demo”. 

SCHLIX Demo Template file content

Here’s what the basic minimum requirements:

  • A file called index.php that contains the basic layout of your template (see the figure above)
  • If you need to create a separate template file other than index.php, it must have a .template.php extension. e.g. two-column.template.php. When you create this file, it will automatically listed in the menu editor under the Theme tab.

2. Functions



<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= SCHLIX\cmsPageOutput::HTMLPageTitle() ?></title>
<meta name="description" content="<?= SCHLIX\cmsPageOutput::HTMLMetaDescription() ?>" />
<meta name="keywords" content="<?= SCHLIX\cmsPageOutput::HTMLMetaKeywords() ?>" />
<?= SCHLIX\cmsPageOutput::HTMLHeader() ?>



<div id="navbar">
<?= SCHLIX\cmsPageOutput::BlockCategory('menu_top'); ?>

<div id="left-column">
<?= SCHLIX\cmsPageOutput::BlockCategory('left'); ?>

<div id="main-app-output">
<?= SCHLIX\cmsPageOutput::BreadCrumbs() ?>
<?= SCHLIX\cmsPageOutput::ApplicationBody() ?>

<div id="footer">
<?= SCHLIX\cmsPageOutput::BlockCategory('footer'); ?>



SCHLIX\cmsPageOutput::HTMLPageTitle() displays the title of the page
SCHLIX\cmsPageOutput::HTMLMetaKeywords()  displays the meta keyword of the page, app or site
SCHLIX\cmsPageOutput::HTMLMetaDescription()  displays the meta description of the page, app or site
SCHLIX\cmsPageOutput::BlockCategory('block_category'); where the block category usually indicates the position of the block on the page. It can be top, bottom, left, right, or anything that you’ve defined in the Blocks Position editor. For instance, your website navigation menus is placed on the left side, so if you’d like to specifically display it, you may call the function SCHLIX\cmsPageOutput::BlockCategory('left');
SCHLIX\cmsPageOutput::BreadCrumbs() displays the navigation breadcrumb
SCHLIX\cmsPageOutput::ApplicationBody() this function display the page content

4. Packaging your theme

SCHLIX template is distributed as a ZIP file. To package your theme go up one directory level and zip the whole folder yourtemplatename. The directory must be included in the ZIP file. It it highly recommended to use lowercase for all the name.

5. Testing your template

To test the installation of your package, go to the Administration site, and click Site -> Templates and upload the ZIP file.

If everything works correctly, you should be able to see the preview.