Understanding the xSwatch4 theme
Themes
34806
Choose the xSwatch4 theme for your website and arrange it exactly as you wish.
This very detailed tutorial will explain how this theme is structured and will guide you step by step to adapt it to your needs.
This very detailed tutorial will explain how this theme is structured and will guide you step by step to adapt it to your needs.
You do not have access to all of this tutorial.
To access all the pages (), you must be a member of the site.
Registration is therefore compulsory but free!
To access all the pages (), you must be a member of the site.
Registration is therefore compulsory but free!
Template theme.tpl - Requirements
This is the main file that structures the theme.
It is the basis of everything.
Let's have a look at it in detail so that we can see the elements that make it up.
1. HTML
The theme.tpl file is a HTML file.This means that it is preferable to have some knowledge of HTML to be able to intervene more easily and better understand what you are modifying.
2. Template
The theme.tpl file is a HTML special file for XOOPS, it is a template.The templates
Templates were created to allow the separation of information processing and display.This gives us:
- The PHP for data processing:
Interfacing with the database, calculations, managing cookies and sessions, processing strings... - The HTML:
Associated with style sheets, for the presentation of data in tables, with colours and images.
3. CSS
So this is a template, a file for the design of the theme. it makes heavy use of cascading style sheets (CSS, for Cascading Style Sheets).It is therefore wise to have some knowledge of CSS.
4. Bootstrap V4 (4.6)
In addition, this theme uses a very well known CSS library called Bootstrap, here, version 4.6.You don't need to know Bootstrap perfectly, the documentation is quite good, just follow it.
Bootstrap V4
This theme, xSwatch4 uses the subscript "4" to indicate that it works with the latest version of Bootstrap in version 4, 4.6.It is therefore important, for any modification, to follow the documentation of Bootstrap version 4 and not the latest version currently, V5.1
Bootstrap 4.6 documentation
5. Smarty
This template uses smarty, which are variables and functions that will be displayed and executed when the page is called.Examples of variables:
<{$xoops_sitename}>, <{$xoops_pagetitle}>, <{$xoops_uname}>
Examples of functions:
<{include file="$theme_name/tpl/nav-menu.tpl"}>, <{if $xoops_isuser|default:false}>
Understanding smarty will make it easier to customize your pages.
Understanding smarty in XOOPS
This tutorial is not yet available.
6. Template modifications
By default, for a stable production site, templates are no longer compiled and the system uses "cache" files to save display time.In development mode and modification of the design, we must change this mode.
Just go to the [Control Panel] then [Preferences] then [General Preferences] and go to the line:
Check templates for modifications?
If this option is enabled, modified templates will be automatically recompiled when they are displayed. You must turn this option off on a production site.
You must set the option to Yes.
6a. Template caching
Sometimes it is necessary to remove the cache so that changes are visible.It should be deleted in 2 places:
- XOOPS cache:
[Configuration panel] then [Maintenance] then [Clean cache folder] then select the 3 cache folders (smarty_cache, smarty_compile and xoops_cache) and finally button Submit. - Browser cache:
This differs depending on the browser used.