- Created by Documentation, last modified on Dec 12, 2017
Introduction
The meta.json
file stores your Site Publisher template's information. Every Site Publisher template that you create must include a meta.json
file in the main template directory. cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) uses this file to display template information and generate the form fields in the Customize and Publish step.
Important:
Each meta.json
file must include the information
hash and may include one or more hashes in the fields
array.
Note:
This file does not store user-entered information. The system stores that data in the configuration file for each Site Publisher website.
The information
hash
The information
hash contains all of the data that cPanel uses for individual Site Publisher templates.
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
id | string | Required The template ID. This value is also the template's directory name. | A valid string. | my_template |
name | string | Required The template's display name. cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) displays this name in the Select a Template section. | A valid string. | My Template |
date | string | The template's creation date. cPanel's Site Publisher interface ( cPanel >> Home >> Domains >> Site Publisher ) uses this value to determine the template's display order in the list of templates. If you do not supply a value, the cPanel interface sorts the template to the end of the template list. Note: We introduced this parameter in cPanel & WHM version 62. | A valid date, in
| 2017-01-01 |
description | string | Required The template's description. cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) displays this text in the Select a Template section. | A valid string. | A one-page placeholder website. |
preview_image_path | string | Required The path to the template's preview image. Note: Preview images must be at least 370 by 200 pixels. The system will automatically shrink larger images. | The path to a Important: This file must use the | img/preview.png |
The fields
array
The fields
array includes hashes of data for each custom field that the Customize and Publish section of cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) displays. You can use these variables in the Template Toolkit files in your template in order to allow users to customize the information that their websites display.
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
id | string | Required The field's unique ID. | A valid string. | description |
label | string | Required The field's label. cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) displays this label with the form field in the Customize and Publish section. | A valid string. | Description |
type | string | Required The field type. This value determines the type of form field that cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) displays. Notes:
| A Site Publisher-supported field type:
For more information, read Mozilla's HTML5 <input> documentation. | text |
placeholder | string | The default placeholder value that cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) displays before the user enters a value for the If you do not supply a value, the interface will not display placeholder text for that input field. | A valid string. | This site is under construction. |
min | string | The minimum value that cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher) will allow for a value in the date , datetime , datetime-local , number , or range field types. |
| 2012-06-29 |
max | string | The maximum value that cPanel's Site Publisher interface ( cPanel >> Home >> Domains >> Site Publisher ) will allow for a value in the date , datetime , datetime-local , number , or range field types. |
| 2014-03-29 |
value | string | The default value for the Note: We added this functionality in cPanel & WHM version 60. | A valid value for the selected field type. | #4acaa8 |
Example
{ "information": { "id": "my_template", "name": "My Template", "date": "2017-01-01", "description": "A one-page placeholder website.", "preview_image_path": "img/preview.png" }, "fields": [{ "id": "text_field", "label": "A Text Field", "type": "text", "placeholder": "This text will appear until the user enters a value." }, { "id": "password_field", "label": "A Password Field", "type": "password", "placeholder": "This text will appear until the user enters a value." }, { "id": "textarea_field", "label": "A Large Text Box", "type": "textarea", "placeholder": "This text will appear until the user enters a value." }, { "id": "checkbox_item", "label": "Check the checkbox?", "type": "checkbox" }, { "id": "color_field", "label": "Pick a Color", "type": "color", "value": "#4acaa8" }, { "id": "date_field", "label": "Date", "type": "date", "min": "2012-06-29", "max": "2014-03-29" }, { "id": "datetime_field", "label": "Date, Time, and Timezone", "type": "datetime", "min": "2012-06-29", "max": "2014-03-29" }, { "id": "datetime-local_field", "label": "Date and Time", "type": "datetime-local", "min": "2012-06-29", "max": "2014-03-29" }, { "id": "email_field", "label": "Email Address", "type": "email", "placeholder": "user@example.com" }, { "id": "month_field", "label": "Month and Year", "type": "month" }, { "id": "number_field", "label": "A Number", "type": "number", "min": "0", "max": "10" }, { "id": "range_field", "label": "A Range", "type": "range", "min": "0", "max": "10" }, { "id": "search_field", "label": "A Search Box", "type": "search", "placeholder": "This text will appear until the user enters a value." }, { "id": "tel_field", "label": "A Telephone Number", "type": "tel", "placeholder": "555-555-1212" }, { "id": "time_field", "label": "A Time", "type": "time" }, { "id": "url_field", "label": "URL", "type": "url", "placeholder": "http://www.cpanel.com" }, { "id": "week_field", "label": "A Week and Year", "type": "week" }] }
Site Publisher Templates
- Site Publisher templates allow novice cPanel users to create simple websites quickly and easily.
- Users can select templates and create websites via cPanel's Site Publisher interface (cPanel >> Home >> Domains >> Site Publisher).
Compatible with:
- cPanel 56+
Related Documentation
-
Page:
-
Page:
-
Page:Guide to Site Publisher Templates - The meta.json File — The
meta.json
file stores your Site Publisher template's information. -
Page:Guide to Site Publisher Templates - Template Files — This document provides basic information about the files that most templates include.
-
Page: