Development Guides Home >> Guide to Site Publisher Templates

Guide to Site Publisher Templates - The Configuration File

Introduction

The Site Publisher feature publishes configuration data with each Site Publisher website's files.

Warning:

We strongly recommend that users do not modify configuration files directly. Direct edits to these files may cause problems in cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher).


Each Site Publisher website includes a configuration file in the target domain's home directory (document root).

  • The system stores configuration data in the / home/user/site_publisher/configurations/ directory, where user represents the cPanel account's username. It saves this file as the home-user-public_html-example.com.json file, where home-user-public_html-example.com represents the Site Publisher website's target directory, with hyphens ( - ) instead of slashes ( / ).
  • cPanel's Site Publisher interface ( cPanel >> Home >> Domains >> Site Publisher ) uses these files to retrieve information about existing Site Publisher websites.
  • This file contains a hash of JSON-formatted parameters and values for the domain's Site Publisher website.

The configuration file

Each configuration file contains the following parameters:

Parameter Type Description Possible values Example
path string The absolute path to the directory that contains the website's template.
  • /var/cpanel/customizations/site_templates/ — The root user's templates.
  • /home/username/var/cpanel/reseller/site_templates/ — A reseller's templates, where username represents the reseller's username.
  • /usr/local/cpanel/3rdparty/share/site_templates/ — cPanel-provided templates.
/usr/local/cpanel/3rdparty/share/site_templates
template string The template's name. The template name. This file uses the name of the template's directory within one of the site_templates directories as the template name. under_construction
docroot string The domain's home directory. The absolute path to the directory to which the user published the Site Publisher website. /home/username/public_html/example.com

Example

In this example, description and email_address are template-specific values.

{
     "path":"/usr/local/cpanel/etc/site_templates",
     "description":"This is my website. It's coming soon!",
     "template":"under_construction",
     "email_address":"user@example.com",
     "docroot":"/home/username/public_html/example.com"
}