Guide to Site Publisher Templates - The meta.json File

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 (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.

The information hash must contain the following parameters:

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 (Home >> Domains >> Site Publisher) displays this name in the Select a Template section.

A valid string.

My Template

description

string

Required

The template's description. cPanel's Site Publisher interface (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 apreview.png file, relative to the template directory.

Important:

This file must use thepreviewfilename andthe .png file extension. 

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 (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. 

Each hash within the fields array must contain the following parameters:

 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 (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 (Home >> Domains >> Site Publisher) displays.

Notes:

  • Older browsers may not support all HTML5 field types. Most older browsers revert to the text ortextarea types for field types that they do not support.
  • The way in which some HTML5 field types display depends on the specific browser and its version.

A Site Publisher-supported field type:

  • checkbox — A checkbox.
  • color  — A color value.
  • date — A date.
  • datetime — A date, time, and timezone.
  • datetime-local — A date and time.
  • email — An email address.
  • month — A month and year.
  • number — A numeric value.
  • password — A password.
  • range — A numeric value within a range.
  • search — A search field.
  • tel — A telephone number.
  • text — A single-line text box.
  • textarea — A multi-line text box.
  • time — A time.
  • url — A URL.
  • week — A week and year.

For more information, read Mozilla's HTML5 <input>documentation.

text

placeholder

string

The default placeholder value that cPanel's Site Publisherinterface (Home >> Domains >> Site Publisher) displays before the user enters a value for the email, number, password,search, tel, text, textarea, and url field types.

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 (Home >> Domains >> Site Publisher) will allow for a value in the date, datetime, datetime-local, number, or range field types.

  • For the number andrange types, a valid integer.
  • For the date,datetime, anddatetime-local types, a valid date in YYYY-MM-DD format, where:
    • YYYY represents the four-digit year.
    • MM represents the two-digit month.
    • DD represents the two-digit date.

2012-06-29

max

string

The maximum value that cPanel's Site Publisher interface (Home >> Domains >> Site Publisher) will allow for a value in the date, datetime, datetime-local, number, or range field types.

  • For the number andrange types, a valid integer.
  • For the date,datetime, anddatetime-local types, a valid date in YYYY-MM-DD format, where:
    • YYYY represents the four-digit year.
    • MM represents the two-digit month.
    • DD represents the two-digit date.

2014-03-29

 

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
  "information": {
    "id": "my_template”,
    "name": "My Template",
    "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"
  },
  {
    "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"
  }]
}
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....