cPanel® Blog

Customizing Paper Lantern

Paper Lantern made its debut in cPanel & WHM version 11.42 around February of this year. We said, at the time, that 11.42 was just the beginning. In 11.46, we’re turning our attention to the single most frequently requested feature for Paper Lantern.

Customization

A month ago, we updated the Paper Lantern demo server with upcoming support for styles. You can use styles to customize the look and feel, fonts, and colors of Paper Lantern. Here are some specifics that you may have missed:

  • The Change Styles interface, located in the User Preference menu, now applies custom styles to your account.
  • It’s now possible to deploy a style to more than one user by placing it in one of three locations, based on which users you want to target. cPanel’s upcp process leaves it alone in all of these locations.
  • We created style examples for many common overrides, as well as how-tos for implementing your custom styles.
  • We deprecated the use of cpanel_magic_revision in favor of a new style cachebusting system. If you’ve ever fought with cpanel_magic_revision, this should be a big relief.
  • We standardized even more files on the .html.tt file extension. We’re now a proper TemplateToolkit implementation.
  • Plugin developers using our LivePHP API can now invoke Paper Lantern user interface chrome so that their applications appear natively inside Paper Lantern, including any customizations.

This week, we updated our demo server with support for a very common feature request: Custom Content. Using a system that we call “UI Includes,” you can now inject your own custom content into the templates of the user interface. Use them to customize the Quick Links or Footer. Use them to create sidebar elements. Use them to provide inline documentation and tips for your users. Use them to embed multimedia. Use them for anything.

UI Includes that live in /var/cpanel/customizations/includes will be visible to all users on the system. UI Includes that live in /home/${reseller}/var/cpanel/reseller/includes will only be visible to reseller user accounts.

Creating a file called global_header.html.tt in these directories will embed your custom content into the header area of Paper Lantern. For example, you would use this location to customize the Quick Links found on every page. Similarly, content in global_footer.html.tt will replace the footer area on every page.

But it goes even further than that. To target footers on the pages inside Addon Domains only, create an addon_domains_page_footer.html.tt file. cPanel will only inject its content into headers on the pages within Addon Domains. The addon_domains portion of these file names comes from the appkey for those features.

UI Includes, combined with updates made to LivePHP and the new plugin registration system, make it possible to deeply integrate with Paper Lantern. We can’t wait to see what you come up with!

Update 2014-12-03: corrected the filename for the UI Include which would inject content into the footer of pages in the Addon Domain feature. The filename must end with “page_footer.html.tt”. Thanks to OakHosting.net for reporting the problem.
  • Gavin Klose

    Does anyone know what happened to the header navigation to popular links (Add-on Domains, File Manager, etc)? I really liked it but noticed it vanished a couple of months ago. I can not see any settings to turn this back on. Does anybody know what happened or whether it can be restored? Note: I am not a coder.

  • Josh Hughbanks

    Anyone know how to target only the index header of the theme? I tried index_page_header.html.tt and index_page_global_header.html.tt with now luck. Has anyone written more documentation for this as cpanels is lacking a bit.

  • Marie-Neige Guérin
  • Thank you..
    آپلود عکس

  • David Fraiser

    Sounds like development is moving along nicely! I look forward to cP 11.46. 🙂