Overview
Nexus uses themes (or templates) to control the appearance of the application. With themes, you can control a large part of the look and feel of the application. Although the number of template files is pretty large, you don't have to recreate all of them to make minor modifications. Instead, simply create a copy of the default theme folder - call it mytheme - and then delete all files that you do not want to modify. When the Nexus engine needs a template file or an image, it will first look in the active theme's folder (mytheme in this case) then attempt to find it in the default theme folder.
The advantage of this system is that your custom theme only needs to include those files that are going to be changed and leave the rest as is. So, for example, if you want to modify the header to include your own company's logo instead of the nexus logo, you have two options.
With both options, you will start off by creating a new folder in the themes directory called mytheme.
- Replace the image containing the logo only
With this option, you simply have to find the file with the logo embedded - in this case banner_right.jpg. Use an image editor to replace the logo in the image with your own logo. Now, in your mythemes directory create a folder called images and save the new image with the name banner_right.jpg to this folder.
OR
- Replace the template header code
Although there are many template files, there's only one that dictates the appearance of the majority of the pages in Nexus and this ismain.tpl.html. This file contains the "wrapper" or "framework" for every page in the system. This includes the header area and you can save a copy of this file into the root of your mythemes directory. Now use a text editor to modify the html to include your own header with your own logo (which you will probably want to save to the images folder of the mythemes directory - you will have to create it).
Once you're done with that, you now have to tell Nexus to use your template. You can do this by modifying the share.config.php file in theconfig folder of your Nexus installation. Find the setting DEFAULT_THEME and change it to read mytheme instead of default. Now logout and log back in to Nexus - this is sometimes necessary to clear out the session variables and make sure that the application object is fresh.
Templates and Smarty
Nexus uses the Smarty templating engine to do the work of transforming templates into executable PHP code. It does a good job of caching templates that have not changed to lower the server load. The downside is that those who are familiary with PHP but not with Smarty will have a learning curve to adjust to though it is not a steep one. Smarty is relatively simple which is why it was chosen.
Those who are familiar with Smarty will notice something unusual about smarty tags in Nexus templates: rather than using curly brances as delimiters, Nexus uses the following:
Start delim: <smarty:
End delim: />
The reason for this is simple: HTML parsers which are not familiar with this tag will generally just ignore/hide the contents of the smarty tags which can be good when you have to do any WYSIWYG editing with your template code.
Available variables in Smarty/Nexus are not documented here because they are subject to change on a pretty regular basis. As they become formalized, you will start to see some more documentation - probably right here.