File Structure
TIP
The Lagom template contains a developer-friendly file structure which allows to easily modify the Lagom theme.
Config
templates/lagom/core/config/
The config catalogue includes files which may alter the theme final look.
activepages.php - declaration of which group a given subpage belongs to - responsible for highlighting the currently active page in the main menu
layouthelpers.php - a table of subpages where sidebars and headers can be ignored or a custom sidebar New
maingridclasses.php - a table of subpages for which custom classes are defined for container .main-grid
pageheader.php - a table of subpages for which additional elements or classes are defined for container: .main-header
paymentbuttons.php - a helper that allows to alter default payment methods buttons at page View Invoice
templateclasses.php - a table of subpages for which additional classes are defined for containers: .main-body
and .body
Hooks
templates/lagom/core/hooks/
Hooks allow you to execute your own code when events occur inside WHMCS. Hooks implemented in the Lagom theme do not interfere with other themes.
hook.php - an extra file with Lagom hooks including functions responsible for the changes in the look and functioning of:
- Navbars - customize navbar
- Sidebars customize sidebars
- Active Pages / Groups
- Layout Helpers
- Template Classes
- Main Grid Classes
- Order Redirection
- Page Header Type
- Market Connect Banners
Create custom hooks
- Proceed to
templates/lagom/core/hooks/
and create a fileexample.php
. You may use your custom preferable name. - Paste your code in the just created file - just like you do that in case of default WHMCS hooks.
Lang
templates/lagom/core/lang/
In order to enhance the Lagom theme, extra language files have been created.
Override the language file
- Create a new folder named
overrides
with thetemplates/lagom/core/langs/
directory. - Copy the language file you want to override. For example, to create an override for the English language you create
templates/lagom/core/langs/english.php
. - Open the newly created file in your preferred editor, and edit the translations.
- Translations in the Lagom theme are triggered by:
{$rslang->trans('KEY_1.KEY_2')}
- eg.
{$rslang->trans('social.social_network_acc')}
WARNING
When modifying or adding new translations you must remember about a correct array structure. Any syntax errors will cause interruptions in the theme usage.
Layouts
templates/lagom/core/layouts/
Precise details of the Layout catalogue can be found here
Styles
templates/lagom/core/styles/
Precise details of the Styles catalogue can be found here
rstheme.php
templates/lagom/core/rstheme.php
The main theme file including details on the theme licence, version and addon configuration.
WARNING
Removing any of the folders or files that are originally located in the core
catalogue may lead to numerous errors with the theme management or completely unable its usage.