christmas sale
40%
discount for lifetime!
See plans down arrow

Create Templates For Pages

Create your templates for pages in Lagom

There is a special developer-friendly system of creating your own templates for pages introduced on the Lagom theme. Follow the below steps and enjoy your personal Lagom pages.

Create New Template for Page

Prepare the files

  1. Go to templates/lagom/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 example login as the file name is login.tpl
  2. 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.

  1. Before you will be able to change the page template, you need to create a folder with the new template. For example boxed-departments
  2. 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
    ]
];
  1. 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 be login.tpl file.

  2. 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.
    Lagom Theme - Create Template for Page

  3. 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

  4. 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:
Lagom Theme - Files Structure for Pages

Activate the page template

  1. Go to RSThemes addon in your WHMCS admin area
  2. Go to "Pages" tab, and find the newly created page, in our example it will be Login, and click Manage

RS Studio Theme Manager - Pages List

  1. Choose the created template and click Save

RS Studio Theme Manager - Page Options List

WARNING

Please be careful when ou edit this cide, each error in the code may lead to numerous errors and interrupt fluent management of the theme or completely unable its usage. That's why we suggest to make thius modyfication on development environment.