Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Configuring your website

Johan Strydom edited this page Aug 6, 2021 · 4 revisions

From the site root, within the conf folder there is a file called site.conf.php

The very first thing you need to do is to open the file in a text editor.

You will see the following global configurations:

$_WEB_CONFIG['NAME'] = 'Tsama';

You need to change this to the name of your website

$_WEB_CONFIG['LOGO'] = 'SVG';

Default logo file format. Options are PNG, SVG or ''. If '' then no logos will be displayed, only the site name.

$_WEB_CONFIG['LOGO_PNG'] = 'tsama-icon.png'; 
$_WEB_CONFIG['LOGO_PNG_W'] = "32"; //Width
$_WEB_CONFIG['LOGO_PNG_H'] = "32"; //Height

The PNG logo file info. You should change this to your own logo file.

$_WEB_CONFIG['LOGO_SVG'] = '<svg width="32" height="32" class="me-2" viewBox="0 0 50.8 50.8" role="img" xmlns="http://www.w3.org/2000/svg"><title>Tsama</title><path fill-rule="evenodd" clip-rule="evenodd" d="m25.403 1.0........5328z" fill="#668933"/></svg>';
$_WEB_CONFIG['LOGO_SVG_W'] = '32'; //Width
$_WEB_CONFIG['LOGO_SVG_H'] = '32'; //Height

The SVG logo file info. You should change this to your own logo file. I normally use Inkscape to create and export my logos. Inkscape also have a nice SVG optimization feature.

$_WEB_CONFIG['THEME'] = 'default';
$_WEB_CONFIG['THEME_COLOR'] = '#668933'; 

The default theme of your website. You can modify this if you use a custom theme or use a toolset other than Bootstrap where the theme name can be totally customized.

$_WEB_CONFIG['LAYOUT'] = 'default';

The default layout for your site. You can customize this if required. See our example code. Tsama also allow you to specify different layouts for different pages but that is activated elsewhere.

$_WEB_CONFIG['LANGUAGE'] = 'en';

The default language of your website.

$_WEB_CONFIG['ARTICLE'] = 'carousel';

An optional config that overrides the default article to show. Comment out to show the article called default.

$_WEB_CONFIG['DEBUG'] = TRUE;

Whether Tsama should show debug information. This should be FALSE in production.

$_WEB_CONFIG['MAINTENANCE_MODE'] = FALSE;

Whether your website is in maintenance mode. Tsama will then show the Maintenance page from the library catalog.

Accessing the configs via code

Tsame have a static method that will allow access to these configs. Example code:

//Use Tsama namespace
namespace Tsama;

//Get the $_WEB_CONFIG
$siteConf = Server::GetWebsiteConfig();

//Get the LOGO_SVG config
$svgLogoIcon = $siteConf['LOGO_SVG'];

NEXT » Predefined constants and global variables «