cPanel Plugin - Using A Custom Template

The LiteSpeed Web Cache Manager plugin for cPanel can be customized to load a custom template through the LiteSpeed WHM plugin. A custom template allows a hosting provider to modify or completely replace the content of the LiteSpeed Web Cache Manager plugin's landing page for all cPanel users without modifying existing plugin files directly.

Preparing and using a custom template for the LiteSpeed Web Cache Manager plugin for cPanel is an easy process. Simply navigate to /usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/landing and create a directory named for your custom template, such as myCustomTemplate.

Once you have created the template directory, you can either copy the existing index.php file under /usr/local/cpanel/base/frontend/paper_lantern/ls_web_cache_manager/landing/default into this directory to get started, or copy over your own version from elsewhere. This file will handle calling any custom code or files you need to manage. It will display the new landing page while still having relative access to all the existing classes, functions, and pages already built into the plugin.

Note: It is strongly recommended that all custom template code be backed up at different location to prevent possible loss of the LiteSpeed Web Cache Manager plugin during uninstall or upgrade. As such, we also recommend using a symlink in place of these files in the actual plugin location.

To set a custom template for use, first make sure that the LiteSpeed Web Cache Manager plugin has been installed through the LiteSpeed WHM plugin. Once this step has been completed, select the Settings icon from the cPanel Plugin section of the LiteSpeed WHM plugin.

You should now be on the cPanel Plugin Settings page which will display a Use Custom Template setting field.

Here you can set a custom template to be used if it has already been created. Using the example from the previous section, we would enter myCustomTemplate here and save. If the template folder exists and contains the required index.php file, the save operation should succeed. From now on, all cPanel users should see your custom landing page when accessing the LiteSpeed Web Cache Manager plugin through the cPanel dashboard.

  • Admin
  • Last modified: 2018/07/18 13:55
  • by Michael Alegre