Skip to content

Custom Templates

Nicholas K. Dionysopoulos edited this page Nov 6, 2023 · 1 revision

Some white-labeling use cases require more customisation than what Custom CSS can provide. For example, changing the application logo, the application name, or the overall layout of the page. In these use cases you can use custom templates, and template overrides.

This feature is available starting with Panopticon 1.0.4. Implemented with Issue #249.

Custom templates

You can create a custom template by copying the templates/default folder into a differently named folder under your installation's templates folder, e.g. templates/test.

Edit the template.json file and change the name of the folder. You can use a language string or a human readable string. Both of the following examples are valid:

{"name": "SOME_LANGUAGE_STRING"}
{"name": "My example template"}

Edit the index.php file in your custom template to change the way Panopticon looks.

The file php/pagination.php is used to render the pagination at the bottom of long lists. If it's missing, Panopticon falls back to a very ugly default.

Finally, go to Administration, System Configuration and select your custom template from the list.

View template overrides

You may find yourself wanting to change the layout of a specific page in Panopticon. Pages are rendered from view template files which are written in the Blade template language. They are found in the ViewTemplates folder of your installation. DO NOT change the files in the ViewTemplates folder! Instead, create template overrides.

One method for creating view template overrides is described in Advanced Customisation (user code), using files under the user_code folder. These overrides apply regardless of the template you are using.

If you want to create an override only for a specific template, the process is slightly different.

Create the html folder inside your template's directory. If you have created a custom template called test, create the folder templates/test/html. Then, copy the folders and files from the ViewTemplates folder into your html folder, e.g. copy ViewTemplates/main/default.blade.php into templates/test/html/main/default.blade.php to customise Panopticon's main page.

Tip: If you do not see your changes taking effect immediately, delete the contents of the tmp/compiled_templates folder.

Make sure you frequently check your view template overrides against the original files supplied with Panopticon. Many new features and bug fixes take place in the code included in the view templates.

Mind the license!

Akeeba Panopticon is released under the GNU Affero General Public License, version 3 of the license or, at your option, any later version of the license published by the Free Software Foundation.

Unlike the plain old GNU General Public License (GPL), the GNU Affero General Public License (AGPL) requires you to publish any and all code making use of AGPL software — including modifications to the software itself — under the AGPL license, for free, to anyone using your software. That's spelled out in article 13 of the license.

This requirement applies to custom templates and view template overrides even if you do not use any of the code included in Panopticon. The reason is that neither templates, nor view templates, are standalone software. They are included by Panopticon's main code to be rendered. Since they become part of Panopticon they have to use the same license as Panopticon and are subject to the license's terms.

Clone this wiki locally