Create Page Template
Create your templates for pages in Lagom
There is a special developer-friendly system of creating your own templates for pages which ALREADY EXIST IN WHMCS introduced on the Lagom theme. Follow the below steps and enjoy your personal Lagom pages. This won't allow you to create new pages for WHMCS, if you are intrerested in doing this please fallow this documentation.
Prepare the files
- Go to
templates/lagom/core/pages/
on your server and create a new folder with the same name as the.tpl
file for which you want to create a template. For examplelogin
as the file name islogin.tpl
- In newly created folder, please create a
page.php
file and paste to this file below code, edit the values of array keys:
<?php
return [
'display_name' => '', // Name of modify page
'description' => '', // Descirption of modify page
'group' => '', // Page Group displayed in Theme Manager // values: Client Area, Orderform
'preview' => '', // Page preview image name - upload it to this catalogue, or leave empty if you don't want use it
'variables' => [ // Additional smarty variables // 'variable' => 'value' // leave empty if you don't want use it
],
];
Since now newly created page, will be visible in the RSThemes addon.
- Before you will be able to change the page template, you need to create a folder with the new template. For example
boxed-departments
- In this folder please create
pageoption.php
file and paste to this file below code, edit the values of array keys:
<?php
return [
'display_name' => '', // Name of modify page
'description' => '', // Descirption of modify page
'preview' => '', // Page preview image name - upload it to this catalogue, or leave empty if you don't want use it
'variables' => [ // Additional smarty variables // 'variable' => 'value' // leave empty if you don't want use it
]
];
Staying in previous folder, please create an new
.tpl
file - and name it the same as the.tpl
file for which you want to create the template.tpl
. In our example this will belogin.tpl
file.Open the
.tpl
file for which you want to create the tempalte. In our example this will be/templates/lagom/login.tpl
and copy the code, inside the{else}
tag.
Paste copied code to the
.tpl
template file which you created in step 5. In our example this will be/templates/lagom/core/pages/login/boxed-departments/login.tpl
Make the necesarry edits in the copied code.
Once everything is correctly performed, the correct folder structure of the page tempalte should look like this:
Activate the page template
- Go to RSThemes addon in your WHMCS admin area
- Go to "Pages" tab, and find the newly created page, in our example it will be
Login
, and click Manage
- Choose the created template and click Save
WARNING
Please be careful when you edit this code, each error may lead to numerous errors and interrupt fluent management of the theme or completely unable its usage. That's why we suggest to make this modyfication on development environment.