We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - SiteTemplates::list_site_templates
Skip to end of metadata
Go to start of metadata

Description

This function lists available templates for cPanel's Site Publisher feature.

  • If you call this function as the root or system user, the function lists the root user's templates.
  • If you call this function as a reseller, the function lists the root user's templates and the reseller's templates.
  • If you call this function as a cPanel user, the function's output depends on the account's owner:
    • If the root user owns the account, the function only lists the root user's templates.
    • If a reseller owns the account, the function lists the root user's templates and that reseller's templates.

Note:

The template directory's location depends on whether the root user or a reseller owns the 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/etc/site_templates/ — cPanel-provided templates in cPanel & WHM version 56 through 68.
  • /usr/local/cpanel/3rdparty/share/site_templates/ — cPanel-provided templates in cPanel & WHM version 70 and later.

Important:

In cPanel & WHM version 76 and later, when you disable the Web Server role, the system disables this function.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/SiteTemplates/list_site_templates


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List the available website templates.
$templates = $cpanel->uapi(
    'SiteTemplates', 'list_site_templates'
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List the available website templates.
my $templates = $cpliveapi->uapi(
    'SiteTemplates', 'list_site_templates',
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username SiteTemplates list_site_templates


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"status": 1,
	"errors": null,
	"warnings": null,
	"metadata": {
		"transformed": 1
	},
	"messages": null,
	"data": [{
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"preview": 1,
		"meta": {
			"fields": [{
				"placeholder": "Your Name",
				"id": "fullName",
				"type": "text",
				"label": "Full Name"
			}, {
				"label": "Tag Line",
				"id": "tagLine",
				"type": "text",
				"placeholder": "Tag Line"
			}, {
				"placeholder": "Avatar URL or Image URL",
				"type": "url",
				"id": "avatarURL",
				"label": "Image URL"
			}, {
				"value": "#4acaa8",
				"id": "siteMajorColor",
				"type": "color",
				"label": "Main Template Color"
			}, {
				"id": "aboutMeHeading",
				"type": "text",
				"label": "About Me Heading",
				"placeholder": "About Me"
			}, {
				"placeholder": "About Me Tag Line",
				"label": "About Me Tag Line",
				"type": "text",
				"id": "aboutMeTagLine"
			}, {
				"placeholder": "A few words about yourself.",
				"label": "About Me",
				"type": "textarea",
				"id": "aboutMe"
			}, {
				"placeholder": "A few words about what you do.",
				"id": "thingsIDo",
				"type": "textarea",
				"label": "Things I Do"
			}, {
				"placeholder": "A few words about your accomplishments.",
				"id": "accomplishments",
				"type": "textarea",
				"label": "Accomplishments"
			}, {
				"type": "color",
				"id": "sectionHeaderColor",
				"value": "#777777",
				"label": "Section Header Color"
			}, {
				"value": "#f4f4f4",
				"type": "color",
				"id": "sectionSeparatorColor",
				"label": "Section Separator Color"
			}, {
				"placeholder": "testemail@testemail.com",
				"id": "emailAddress",
				"type": "email",
				"label": "Email Address"
			}, {
				"id": "facebookLink",
				"type": "url",
				"label": "Facebook",
				"placeholder": "https://www.facebook.com/username"
			}, {
				"placeholder": "https://twitter.com/username",
				"label": "Twitter",
				"type": "url",
				"id": "twitterLink"
			}, {
				"placeholder": "https://www.linkedin.com/in/username",
				"id": "linkedinLink",
				"type": "url",
				"label": "LinkedIn"
			}, {
				"type": "url",
				"id": "instagramLink",
				"label": "Instagram",
				"placeholder": "https://www.instagram.com/username"
			}, {
				"placeholder": "https://www.github.com/username",
				"id": "githubLink",
				"type": "url",
				"label": "GitHub"
			}, {
				"type": "text",
				"id": "google_analytics_key",
				"label": "Google Analytics Tracker ID",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"name": "About Me",
				"id": "about_me",
				"preview_image_path": "/preview.png",
				"date": "2016-06-30",
				"description": "Single page 'About Me' site"
			}
		},
		"template": "about_me"
	}, {
		"preview": 1,
		"meta": {
			"information": {
				"preview_image_path": "/preview.png",
				"description": "Single page business site",
				"date": "2016-03-16",
				"id": "business",
				"name": "Business"
			},
			"fields": [{
				"placeholder": "My Company",
				"id": "businessName",
				"type": "text",
				"label": "Business Name"
			}, {
				"label": "Tag Line",
				"id": "tagLine",
				"type": "text",
				"placeholder": "Company Tag Line"
			}, {
				"type": "text",
				"id": "descriptionSectionHeader",
				"label": "Description Header",
				"placeholder": "About us"
			}, {
				"placeholder": "About us content",
				"type": "textarea",
				"id": "description",
				"label": "Description"
			}, {
				"placeholder": "Street Address, My Town, Zip Code",
				"label": "Address",
				"type": "textarea",
				"id": "physicalAddress"
			}, {
				"placeholder": "xxx-xxx-xxxx",
				"label": "Phone Number",
				"type": "tel",
				"id": "phoneNumber"
			}, {
				"placeholder": "xxx-xxx-xxxx",
				"id": "faxNumber",
				"type": "tel",
				"label": "Fax Number"
			}, {
				"id": "emailAddress",
				"type": "email",
				"label": "Email Address",
				"placeholder": "testemail@testemail.com"
			}, {
				"type": "text",
				"id": "businessHours",
				"label": "Business Hours",
				"placeholder": "8:00 AM - 5:00 PM"
			}, {
				"type": "text",
				"id": "businessHoursNotes",
				"label": "Business Hours Notes",
				"placeholder": "Weekends closed"
			}, {
				"placeholder": "https://www.facebook.com/username",
				"label": "Facebook",
				"type": "url",
				"id": "facebookLink"
			}, {
				"placeholder": "https://twitter.com/username",
				"label": "Twitter",
				"id": "twitterLink",
				"type": "url"
			}, {
				"label": "LinkedIn",
				"type": "url",
				"id": "linkedinLink",
				"placeholder": "https://www.linkedin.com/in/username"
			}, {
				"label": "Google Maps URL",
				"id": "googleMapsURL",
				"type": "url",
				"placeholder": ""
			}, {
				"placeholder": "UA-34343-3",
				"label": "Google Analytics Tracker ID",
				"type": "text",
				"id": "google_analytics_key"
			}]
		},
		"template": "business",
		"path": "/usr/local/cpanel/3rdparty/share/site_templates"
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"template": "countdown_fresh",
		"preview": 1,
		"meta": {
			"fields": [{
				"placeholder": "Fresh",
				"id": "data_title",
				"type": "text",
				"label": "Site Title"
			}, {
				"placeholder": "me@mysite.com",
				"type": "email",
				"id": "data_email",
				"label": "Email Address"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"label": "Facebook URL",
				"type": "url",
				"id": "data_social_facebook"
			}, {
				"placeholder": "https://twitter.com/cPanel",
				"id": "data_social_twitter",
				"type": "url",
				"label": "Twitter URL"
			}, {
				"placeholder": "https://www.instagram.com/cpanel/",
				"id": "data_social_instagram",
				"type": "url",
				"label": "Instagram URL"
			}, {
				"type": "url",
				"id": "data_social_pinterest",
				"label": "Pinterest URL",
				"placeholder": "https://www.pinterest.com/cpanel/"
			}, {
				"placeholder": "https://www.linkedin.com/company/cpanel",
				"label": "LinkedIn URL",
				"type": "url",
				"id": "data_social_linkedin"
			}, {
				"placeholder": "https://plus.google.com/+cpanel",
				"label": "Google+ URL",
				"id": "data_social_googleplus",
				"type": "url"
			}, {
				"placeholder": "#AD9861",
				"defaultValue": "#AD9861",
				"label": "Primary Color",
				"id": "style_primary",
				"type": "color"
			}, {
				"placeholder": "/assets/images/fresh/background.jpg",
				"label": "[Countdown] Background Image",
				"type": "text",
				"id": "countdown_backgroundImage"
			}, {
				"placeholder": "#141B20",
				"label": "[Countdown] Background Color",
				"defaultValue": "#141B20",
				"id": "countdown_backgroundColor",
				"type": "color"
			}, {
				"placeholder": "#FFFFFF",
				"label": "[Countdown] Text Color",
				"defaultValue": "#FFFFFF",
				"type": "color",
				"id": "countdown_color"
			}, {
				"type": "text",
				"id": "countdown_buttonText",
				"label": "[Countdown] Button Text",
				"placeholder": "Notify Me"
			}, {
				"type": "url",
				"id": "countdown_buttonLink",
				"label": "[Countdown] Button Link"
			}, {
				"id": "countdown_content",
				"type": "textarea",
				"label": "[Countdown] Content"
			}, {
				"label": "[Countdown] End Time",
				"type": "datetime-local",
				"id": "countdown_dateTime"
			}, {
				"label": "Google Analytics Tracker ID",
				"type": "text",
				"id": "google_analytics_key",
				"placeholder": "UA-34343-3",
				"description": "test"
			}],
			"information": {
				"name": "Countdown: Fresh",
				"id": "countdown_fresh",
				"description": "A natural feel",
				"preview_image_path": "/preview.png"
			}
		}
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"template": "countdown_medical",
		"preview": 1,
		"meta": {
			"fields": [{
				"id": "data_title",
				"type": "Medical",
				"label": "Site Title",
				"placeholder": "Medical"
			}, {
				"placeholder": "me@mysite.com",
				"label": "Email Address",
				"type": "email",
				"id": "data_email"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"label": "Facebook URL",
				"type": "url",
				"id": "data_social_facebook"
			}, {
				"placeholder": "https://twitter.com/cPanel",
				"type": "url",
				"id": "data_social_twitter",
				"label": "Twitter URL"
			}, {
				"id": "data_social_instagram",
				"type": "url",
				"label": "Instagram URL",
				"placeholder": "https://www.instagram.com/cpanel/"
			}, {
				"placeholder": "https://www.pinterest.com/cpanel/",
				"label": "Pinterest URL",
				"type": "url",
				"id": "data_social_pinterest"
			}, {
				"label": "LinkedIn URL",
				"type": "url",
				"id": "data_social_linkedin",
				"placeholder": "https://www.linkedin.com/company/cpanel"
			}, {
				"placeholder": "https://plus.google.com/+cpanel",
				"id": "data_social_googleplus",
				"type": "url",
				"label": "Google+ URL"
			}, {
				"id": "style_primary",
				"type": "color",
				"label": "Primary Color",
				"defaultValue": "#1683C2",
				"placeholder": "#1683C2"
			}, {
				"placeholder": "/assets/images/medical/background.jpg",
				"label": "[Countdown] Background Image",
				"type": "text",
				"id": "countdown_backgroundImage"
			}, {
				"placeholder": "#141B20",
				"id": "countdown_backgroundColor",
				"type": "color",
				"label": "[Countdown] Background Color",
				"defaultValue": "#141B20"
			}, {
				"placeholder": "#FFFFFF",
				"defaultValue": "#FFFFFF",
				"label": "[Countdown] Text Color",
				"type": "color",
				"id": "countdown_color"
			}, {
				"placeholder": "Notify Me",
				"label": "[Countdown] Button Text",
				"id": "countdown_buttonText",
				"type": "text"
			}, {
				"id": "countdown_buttonLink",
				"type": "url",
				"label": "[Countdown] Button Link"
			}, {
				"type": "textarea",
				"id": "countdown_content",
				"label": "[Countdown] Content"
			}, {
				"label": "[Countdown] End Time",
				"type": "datetime-local",
				"id": "countdown_dateTime"
			}, {
				"description": "test",
				"placeholder": "UA-34343-3",
				"id": "google_analytics_key",
				"type": "text",
				"label": "Google Analytics Tracker ID"
			}],
			"information": {
				"name": "Countdown: Medical",
				"id": "countdown_medical",
				"preview_image_path": "/preview.png",
				"description": "For any type of medical provider"
			}
		}
	}, {
		"meta": {
			"fields": [{
				"type": "text",
				"id": "data_title",
				"label": "Site Title",
				"placeholder": "Musician"
			}, {
				"id": "data_email",
				"type": "email",
				"label": "Email Address",
				"placeholder": "me@mysite.com"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"type": "url",
				"id": "data_social_facebook",
				"label": "Facebook URL"
			}, {
				"id": "data_social_twitter",
				"type": "url",
				"label": "Twitter URL",
				"placeholder": "https://twitter.com/cPanel"
			}, {
				"type": "url",
				"id": "data_social_instagram",
				"label": "Instagram URL",
				"placeholder": "https://www.instagram.com/cpanel/"
			}, {
				"placeholder": "https://www.pinterest.com/cpanel/",
				"label": "Pinterest URL",
				"id": "data_social_pinterest",
				"type": "url"
			}, {
				"label": "LinkedIn URL",
				"id": "data_social_linkedin",
				"type": "url",
				"placeholder": "https://www.linkedin.com/company/cpanel"
			}, {
				"label": "Google+ URL",
				"id": "data_social_googleplus",
				"type": "url",
				"placeholder": "https://plus.google.com/+cpanel"
			}, {
				"placeholder": "#EC565A",
				"defaultValue": "#EC565A",
				"label": "Primary Color",
				"type": "color",
				"id": "style_primary"
			}, {
				"label": "[Countdown] Background Image",
				"type": "text",
				"id": "countdown_backgroundImage",
				"placeholder": "/assets/images/musician/background.jpg"
			}, {
				"type": "color",
				"id": "countdown_backgroundColor",
				"label": "[Countdown] Background Color",
				"defaultValue": "#141B20",
				"placeholder": "#141B20"
			}, {
				"placeholder": "#FFFFFF",
				"defaultValue": "#FFFFFF",
				"label": "[Countdown] Text Color",
				"id": "countdown_color",
				"type": "color"
			}, {
				"placeholder": "Notify Me",
				"type": "text",
				"id": "countdown_buttonText",
				"label": "[Countdown] Button Text"
			}, {
				"type": "url",
				"id": "countdown_buttonLink",
				"label": "[Countdown] Button Link"
			}, {
				"label": "[Countdown] Content",
				"id": "countdown_content",
				"type": "textarea"
			}, {
				"label": "[Countdown] End Time",
				"type": "datetime-local",
				"id": "countdown_dateTime"
			}, {
				"id": "google_analytics_key",
				"type": "text",
				"label": "Google Analytics Tracker ID",
				"description": "test",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"description": "Great to countdown the release to your next single",
				"preview_image_path": "/preview.png",
				"name": "Countdown: Musician",
				"id": "countdown_musician"
			}
		},
		"preview": 1,
		"template": "countdown_musician",
		"path": "/usr/local/cpanel/3rdparty/share/site_templates"
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"meta": {
			"fields": [{
				"id": "data_title",
				"type": "text",
				"label": "Site Title",
				"placeholder": "Tech"
			}, {
				"id": "data_email",
				"type": "email",
				"label": "Email Address",
				"placeholder": "me@mysite.com"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"type": "url",
				"id": "data_social_facebook",
				"label": "Facebook URL"
			}, {
				"placeholder": "https://twitter.com/cPanel",
				"type": "url",
				"id": "data_social_twitter",
				"label": "Twitter URL"
			}, {
				"placeholder": "https://www.instagram.com/cpanel/",
				"label": "Instagram URL",
				"id": "data_social_instagram",
				"type": "url"
			}, {
				"id": "data_social_pinterest",
				"type": "url",
				"label": "Pinterest URL",
				"placeholder": "https://www.pinterest.com/cpanel/"
			}, {
				"placeholder": "https://www.linkedin.com/company/cpanel",
				"type": "url",
				"id": "data_social_linkedin",
				"label": "LinkedIn URL"
			}, {
				"placeholder": "https://plus.google.com/+cpanel",
				"type": "url",
				"id": "data_social_googleplus",
				"label": "Google+ URL"
			}, {
				"label": "Primary Color",
				"defaultValue": "#1EC1B7",
				"id": "style_primary",
				"type": "color",
				"placeholder": "#1EC1B7"
			}, {
				"label": "[Countdown] Background Image",
				"type": "text",
				"id": "countdown_backgroundImage",
				"placeholder": "/assets/images/tech/background.jpg"
			}, {
				"placeholder": "#141B20",
				"label": "[Countdown] Background Color",
				"defaultValue": "#141B20",
				"type": "color",
				"id": "countdown_backgroundColor"
			}, {
				"id": "countdown_color",
				"type": "color",
				"defaultValue": "#FFFFFF",
				"label": "[Countdown] Text Color",
				"placeholder": "#FFFFFF"
			}, {
				"id": "countdown_buttonText",
				"type": "text",
				"label": "[Countdown] Button Text",
				"placeholder": "Notify Me"
			}, {
				"type": "url",
				"id": "countdown_buttonLink",
				"label": "[Countdown] Button Link"
			}, {
				"type": "textarea",
				"id": "countdown_content",
				"label": "[Countdown] Content"
			}, {
				"id": "countdown_dateTime",
				"type": "datetime-local",
				"label": "[Countdown] End Time"
			}, {
				"type": "text",
				"id": "google_analytics_key",
				"label": "Google Analytics Tracker ID",
				"description": "test",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"description": "Countdown the release of that next new gadget!",
				"preview_image_path": "/preview.png",
				"id": "countdown_tech",
				"name": "Countdown: Tech"
			}
		},
		"preview": 1,
		"template": "countdown_tech"
	}, {
		"meta": {
			"fields": [{
				"label": "Full Name",
				"id": "fullName",
				"type": "text",
				"placeholder": "Your Name"
			}, {
				"placeholder": "Tag Line",
				"id": "tagLine",
				"type": "text",
				"label": "Tag Line"
			}, {
				"type": "url",
				"id": "avatarURL",
				"label": "Image URL",
				"placeholder": "Avatar URL / Image URL"
			}, {
				"label": "About Me",
				"type": "textarea",
				"id": "aboutMe",
				"placeholder": "Few words about yourself"
			}, {
				"type": "textarea",
				"id": "physicalAddress",
				"label": "Address",
				"placeholder": "City State Country"
			}, {
				"label": "Phone Number",
				"id": "phoneNumber",
				"type": "tel",
				"placeholder": "xxx-xxx-xxxx"
			}, {
				"placeholder": "testemail@testemail.com",
				"type": "email",
				"id": "emailAddress",
				"label": "Email Address"
			}, {
				"placeholder": "https://www.facebook.com/username",
				"type": "url",
				"id": "facebookLink",
				"label": "Facebook"
			}, {
				"id": "twitterLink",
				"type": "url",
				"label": "Twitter",
				"placeholder": "https://twitter.com/username"
			}, {
				"id": "linkedinLink",
				"type": "url",
				"label": "LinkedIn",
				"placeholder": "https://www.linkedin.com/in/username"
			}, {
				"id": "google_analytics_key",
				"type": "text",
				"label": "Google Analytics Tracker ID",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"name": "Personal",
				"id": "personal",
				"preview_image_path": "/preview.png",
				"date": "2016-03-16",
				"description": "Single page personal site"
			}
		},
		"preview": 1,
		"template": "personal",
		"path": "/usr/local/cpanel/3rdparty/share/site_templates"
	}, {
		"template": "under_construction",
		"preview": 1,
		"meta": {
			"fields": [{
				"placeholder": "Title of your website",
				"label": "Title",
				"id": "title",
				"type": "text"
			}, {
				"placeholder": "This website is under construction",
				"label": "Description",
				"id": "description",
				"type": "textarea"
			}, {
				"placeholder": "testemail@testemail.com",
				"type": "email",
				"id": "email_address",
				"label": "Email Address"
			}, {
				"label": "Google Analytics Tracker ID",
				"type": "text",
				"id": "google_analytics_key",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"name": "Under Construction",
				"id": "under_construction",
				"date": "2016-03-08",
				"description": "Single page under construction site",
				"preview_image_path": "preview.png"
			}
		},
		"path": "/usr/local/cpanel/3rdparty/share/site_templates"
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"preview": 1,
		"meta": {
			"fields": [{
				"label": "[vCard] Prefix",
				"id": "vcard_prefix",
				"type": "text",
				"placeholder": "My name is"
			}, {
				"type": "text",
				"id": "vcard_title",
				"label": "[vCard] Your Name",
				"placeholder": "Louis Stanley"
			}, {
				"type": "text",
				"id": "vcard_subtitle",
				"label": "[vCard] Subtitle",
				"placeholder": "UX Developer"
			}, {
				"placeholder": "xxx-xxx-xxxx",
				"label": "Phone Number",
				"id": "data_phone",
				"type": "tel"
			}, {
				"label": "Fax Number",
				"id": "data_fax",
				"type": "tel",
				"placeholder": "xxx-xxx-xxxx"
			}, {
				"placeholder": "me@mysite.com",
				"type": "email",
				"id": "data_email",
				"label": "Email Address"
			}, {
				"placeholder": "Street Address, My Town, Zip Code",
				"label": "Address",
				"id": "data_address",
				"type": "textarea"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"type": "url",
				"id": "data_social_facebook",
				"label": "Facebook URL"
			}, {
				"id": "data_social_twitter",
				"type": "url",
				"label": "Twitter URL",
				"placeholder": "https://twitter.com/cPanel"
			}, {
				"type": "url",
				"id": "data_social_instagram",
				"label": "Instagram URL",
				"placeholder": "https://www.instagram.com/cpanel/"
			}, {
				"id": "data_social_pinterest",
				"type": "url",
				"label": "Pinterest URL",
				"placeholder": "https://www.pinterest.com/cpanel/"
			}, {
				"id": "data_social_linkedin",
				"type": "url",
				"label": "LinkedIn URL",
				"placeholder": "https://www.linkedin.com/company/cpanel"
			}, {
				"id": "data_social_googleplus",
				"type": "url",
				"label": "Google+ URL",
				"placeholder": "https://plus.google.com/+cpanel"
			}, {
				"placeholder": "#FD7344",
				"defaultValue": "#FD7344",
				"label": "Primary Color",
				"type": "color",
				"id": "style_primary"
			}, {
				"defaultValue": "#3C3334",
				"label": "Accent Color",
				"type": "color",
				"id": "style_accent",
				"placeholder": "#3C3334"
			}, {
				"id": "vcard_backgroundImage",
				"type": "text",
				"label": "[vCard] Background Image",
				"placeholder": "/assets/images/dev/background.jpg"
			}, {
				"placeholder": "#141B20",
				"id": "vcard_backgroundColor",
				"type": "color",
				"defaultValue": "#141B20",
				"label": "[vCard] Background Color"
			}, {
				"placeholder": "#FFFFFF",
				"defaultValue": "#FFFFFF",
				"label": "[vCard] Text Color",
				"type": "color",
				"id": "vcard_color"
			}, {
				"placeholder": "Contact Me",
				"id": "vcard_buttonText",
				"type": "text",
				"label": "[vCard] Button Text"
			}, {
				"type": "url",
				"id": "vcard_buttonLink",
				"label": "[vCard] Button Link"
			}, {
				"id": "vcard_portrait",
				"type": "text",
				"label": "[vCard] Portrait",
				"placeholder": "/assets/images/dev/portrait.jpg"
			}, {
				"type": "textarea",
				"id": "vcard_biography",
				"label": "[vCard] Biography"
			}, {
				"id": "google_analytics_key",
				"type": "text",
				"label": "Google Analytics Tracker ID",
				"description": "test",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"id": "vcard_dev",
				"name": "vCard: Dev",
				"description": "Excellent for developers and designers",
				"preview_image_path": "/preview.png"
			}
		},
		"template": "vcard_dev"
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"preview": 1,
		"meta": {
			"information": {
				"name": "vCard: Legal",
				"id": "vcard_legal",
				"preview_image_path": "/preview.png",
				"description": "Great for lawyers, or legal professionals"
			},
			"fields": [{
				"placeholder": "We are",
				"label": "[vCard] Prefix",
				"type": "text",
				"id": "vcard_prefix"
			}, {
				"label": "[vCard] Your Name",
				"type": "text",
				"id": "vcard_title",
				"placeholder": "Hamlin & Partners"
			}, {
				"label": "[vCard] Subtitle",
				"id": "vcard_subtitle",
				"type": "text",
				"placeholder": "Law Firm"
			}, {
				"id": "data_phone",
				"type": "tel",
				"label": "Phone Number",
				"placeholder": "xxx-xxx-xxxx"
			}, {
				"type": "tel",
				"id": "data_fax",
				"label": "Fax Number",
				"placeholder": "xxx-xxx-xxxx"
			}, {
				"placeholder": "me@mysite.com",
				"label": "Email Address",
				"type": "email",
				"id": "data_email"
			}, {
				"placeholder": "Street Address, My Town, Zip Code",
				"id": "data_address",
				"type": "textarea",
				"label": "Address"
			}, {
				"label": "Facebook URL",
				"id": "data_social_facebook",
				"type": "url",
				"placeholder": "https://www.facebook.com/cpanel/"
			}, {
				"placeholder": "https://twitter.com/cPanel",
				"label": "Twitter URL",
				"type": "url",
				"id": "data_social_twitter"
			}, {
				"label": "Instagram URL",
				"type": "url",
				"id": "data_social_instagram",
				"placeholder": "https://www.instagram.com/cpanel/"
			}, {
				"id": "data_social_pinterest",
				"type": "url",
				"label": "Pinterest URL",
				"placeholder": "https://www.pinterest.com/cpanel/"
			}, {
				"label": "LinkedIn URL",
				"id": "data_social_linkedin",
				"type": "url",
				"placeholder": "https://www.linkedin.com/company/cpanel"
			}, {
				"placeholder": "https://plus.google.com/+cpanel",
				"label": "Google+ URL",
				"type": "url",
				"id": "data_social_googleplus"
			}, {
				"placeholder": "#CEAA76",
				"id": "style_primary",
				"type": "color",
				"defaultValue": "#CEAA76",
				"label": "Primary Color"
			}, {
				"label": "Accent Color",
				"defaultValue": "#344A5F",
				"type": "color",
				"id": "style_accent",
				"placeholder": "#344A5F"
			}, {
				"placeholder": "/assets/images/legal/background.jpg",
				"type": "text",
				"id": "vcard_backgroundImage",
				"label": "[vCard] Background Image"
			}, {
				"placeholder": "#141B20",
				"label": "[vCard] Background Color",
				"defaultValue": "#141B20",
				"type": "color",
				"id": "vcard_backgroundColor"
			}, {
				"placeholder": "#FFFFFF",
				"defaultValue": "#FFFFFF",
				"label": "[vCard] Text Color",
				"id": "vcard_color",
				"type": "color"
			}, {
				"type": "text",
				"id": "vcard_buttonText",
				"label": "[vCard] Button Text",
				"placeholder": "Contact Me"
			}, {
				"type": "url",
				"id": "vcard_buttonLink",
				"label": "[vCard] Button Link"
			}, {
				"id": "vcard_portrait",
				"type": "text",
				"label": "[vCard] Portrait",
				"placeholder": "/assets/images/legal/portrait.jpg"
			}, {
				"type": "textarea",
				"id": "vcard_biography",
				"label": "[vCard] Biography"
			}, {
				"placeholder": "UA-34343-3",
				"description": "test",
				"label": "Google Analytics Tracker ID",
				"type": "text",
				"id": "google_analytics_key"
			}]
		},
		"template": "vcard_legal"
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"meta": {
			"fields": [{
				"placeholder": "My name is",
				"label": "[vCard] Prefix",
				"id": "vcard_prefix",
				"type": "text"
			}, {
				"label": "[vCard] Your Name",
				"id": "vcard_title",
				"type": "text",
				"placeholder": "Martha Gonzales"
			}, {
				"type": "text",
				"id": "vcard_subtitle",
				"label": "[vCard] Subtitle",
				"placeholder": "Freelance Graphic Designer"
			}, {
				"placeholder": "xxx-xxx-xxxx",
				"label": "Phone Number",
				"id": "data_phone",
				"type": "tel"
			}, {
				"placeholder": "xxx-xxx-xxxx",
				"label": "Fax Number",
				"id": "data_fax",
				"type": "tel"
			}, {
				"label": "Email Address",
				"type": "email",
				"id": "data_email",
				"placeholder": "me@mysite.com"
			}, {
				"label": "Address",
				"type": "textarea",
				"id": "data_address",
				"placeholder": "Street Address, My Town, Zip Code"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"label": "Facebook URL",
				"id": "data_social_facebook",
				"type": "url"
			}, {
				"placeholder": "https://twitter.com/cPanel",
				"id": "data_social_twitter",
				"type": "url",
				"label": "Twitter URL"
			}, {
				"placeholder": "https://www.instagram.com/cpanel/",
				"type": "url",
				"id": "data_social_instagram",
				"label": "Instagram URL"
			}, {
				"type": "url",
				"id": "data_social_pinterest",
				"label": "Pinterest URL",
				"placeholder": "https://www.pinterest.com/cpanel/"
			}, {
				"label": "LinkedIn URL",
				"id": "data_social_linkedin",
				"type": "url",
				"placeholder": "https://www.linkedin.com/company/cpanel"
			}, {
				"placeholder": "https://plus.google.com/+cpanel",
				"id": "data_social_googleplus",
				"type": "url",
				"label": "Google+ URL"
			}, {
				"placeholder": "#F59079",
				"label": "Primary Color",
				"defaultValue": "#F59079",
				"type": "color",
				"id": "style_primary"
			}, {
				"placeholder": "#154371",
				"label": "Accent Color",
				"defaultValue": "#154371",
				"type": "color",
				"id": "style_accent"
			}, {
				"label": "[vCard] Background Image",
				"type": "text",
				"id": "vcard_backgroundImage",
				"placeholder": "/assets/images/power/background.jpg"
			}, {
				"id": "vcard_backgroundColor",
				"type": "color",
				"label": "[vCard] Background Color",
				"defaultValue": "#141B20",
				"placeholder": "#141B20"
			}, {
				"id": "vcard_color",
				"type": "color",
				"defaultValue": "#FFFFFF",
				"label": "[vCard] Text Color",
				"placeholder": "#FFFFFF"
			}, {
				"type": "text",
				"id": "vcard_buttonText",
				"label": "[vCard] Button Text",
				"placeholder": "Contact Me"
			}, {
				"type": "url",
				"id": "vcard_buttonLink",
				"label": "[vCard] Button Link"
			}, {
				"placeholder": "/assets/images/power/portrait.jpg",
				"type": "text",
				"id": "vcard_portrait",
				"label": "[vCard] Portrait"
			}, {
				"label": "[vCard] Biography",
				"id": "vcard_biography",
				"type": "textarea"
			}, {
				"id": "google_analytics_key",
				"type": "text",
				"label": "Google Analytics Tracker ID",
				"description": "test",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"preview_image_path": "/preview.png",
				"description": "Great for designers",
				"name": "vCard: Power",
				"id": "vcard_talent"
			}
		},
		"preview": 1,
		"template": "vcard_power"
	}, {
		"path": "/usr/local/cpanel/3rdparty/share/site_templates",
		"preview": 1,
		"meta": {
			"fields": [{
				"label": "[vCard] Prefix",
				"type": "text",
				"id": "vcard_prefix",
				"placeholder": "My name is"
			}, {
				"type": "text",
				"id": "vcard_title",
				"label": "[vCard] Your Name",
				"placeholder": "Eugene Simpson"
			}, {
				"label": "[vCard] Subtitle",
				"id": "vcard_subtitle",
				"type": "text",
				"placeholder": "Aspiring Musician"
			}, {
				"placeholder": "xxx-xxx-xxxx",
				"type": "tel",
				"id": "data_phone",
				"label": "Phone Number"
			}, {
				"label": "Fax Number",
				"id": "data_fax",
				"type": "tel",
				"placeholder": "xxx-xxx-xxxx"
			}, {
				"type": "email",
				"id": "data_email",
				"label": "Email Address",
				"placeholder": "me@mysite.com"
			}, {
				"label": "Address",
				"id": "data_address",
				"type": "textarea",
				"placeholder": "Street Address, My Town, Zip Code"
			}, {
				"placeholder": "https://www.facebook.com/cpanel/",
				"label": "Facebook URL",
				"id": "data_social_facebook",
				"type": "url"
			}, {
				"label": "Twitter URL",
				"type": "url",
				"id": "data_social_twitter",
				"placeholder": "https://twitter.com/cPanel"
			}, {
				"placeholder": "https://www.instagram.com/cpanel/",
				"label": "Instagram URL",
				"type": "url",
				"id": "data_social_instagram"
			}, {
				"placeholder": "https://www.pinterest.com/cpanel/",
				"id": "data_social_pinterest",
				"type": "url",
				"label": "Pinterest URL"
			}, {
				"placeholder": "https://www.linkedin.com/company/cpanel",
				"label": "LinkedIn URL",
				"id": "data_social_linkedin",
				"type": "url"
			}, {
				"placeholder": "https://plus.google.com/+cpanel",
				"label": "Google+ URL",
				"type": "url",
				"id": "data_social_googleplus"
			}, {
				"placeholder": "#19B589",
				"label": "Primary Color",
				"defaultValue": "#19B589",
				"type": "color",
				"id": "style_primary"
			}, {
				"placeholder": "#599ABB",
				"defaultValue": "#599ABB",
				"label": "Accent Color",
				"id": "style_accent",
				"type": "color"
			}, {
				"type": "text",
				"id": "vcard_backgroundImage",
				"label": "[vCard] Background Image",
				"placeholder": "/assets/images/talent/background.jpg"
			}, {
				"id": "vcard_backgroundColor",
				"type": "color",
				"label": "[vCard] Background Color",
				"defaultValue": "#141B20",
				"placeholder": "#141B20"
			}, {
				"label": "[vCard] Text Color",
				"defaultValue": "#FFFFFF",
				"type": "color",
				"id": "vcard_color",
				"placeholder": "#FFFFFF"
			}, {
				"label": "[vCard] Button Text",
				"type": "text",
				"id": "vcard_buttonText",
				"placeholder": "Contact Me"
			}, {
				"type": "url",
				"id": "vcard_buttonLink",
				"label": "[vCard] Button Link"
			}, {
				"id": "vcard_portrait",
				"type": "text",
				"label": "[vCard] Portrait",
				"placeholder": "/assets/images/talent/portrait.jpg"
			}, {
				"type": "textarea",
				"id": "vcard_biography",
				"label": "[vCard] Biography"
			}, {
				"type": "text",
				"id": "google_analytics_key",
				"label": "Google Analytics Tracker ID",
				"description": "test",
				"placeholder": "UA-34343-3"
			}],
			"information": {
				"preview_image_path": "/preview.png",
				"description": "Great for musicians and artists",
				"id": "vcard_talent",
				"name": "vCard: Talent"
			}
		},
		"template": "vcard_talent"
	}]
}
		


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
pathstring

The template directory path.

The function returns this value in the unnamed hash.

A valid path.

Note:

The template directory's location depends on whether the root user or a reseller owns the template. 

/usr/local/cpanel/3rdparty/share/site_templates

previewBoolean

Whether the template includes a preview image.

The function returns this value in the unnamed hash.

  • 1 — The template directory contains a preview.png file.
  • 0 — The template directory does not contain a preview.png file. The cPanel interface will display a placeholder image for this template.

1

metahash

A set of data that gives information on the template.

The function returns this value in the unnamed hash.

This has includes the information and fields returns.

information

hash

A hash that provides basic template information.

This function returns this value in the meta hash.

This hash includes the id, description, name, preview_image_path, and date returns.

id

string

A valid template name. 

This function returns this value in the information hash.

Any valid string.about_me

description

string

A valid string describing the template. 

This function returns this value in the information hash.

Any valid string.Single page 'About Me' site

name

string

The template's name.

This function returns this value in the information hash.

 
Any valid string.About Me

 preview_image_path

string

The preview directory path.

This function returns this value in the information hash.

Any valid file path to an image./preview.png

date

string

The template's add date.

This function returns this value in the information hash.

A valid date in YYYY-MM-DD 

  • YYYY  represents the year
  • MM  represents the month
  • DD  represents the day
2016-06-30

fields

array of hashes

This array of hashes shows the information for each field the user can add input in the template.

This function returns this value in the meta hash.

This array contains the id, placeholder, label, and type returns.

id

string

The template's ID.

This functions returns this value in the fields hash.

Any valid string.fullName

placeholder

string

A string that temporarily takes the place of the final data.

This functions returns this value in the fields hash.

Any valid string.Your Name

label

string

The template's label.

This functions returns this value in the fields hash.

Any valid string.Full Name

type

string

The template's type.

This functions returns this value in the fields hash.

  • color
  • datetime-local
  • email
  • Medical
  • tel
  • text
  • textarea
  • url
text
templatestring

The template's name.

The function returns this value in the unnamed hash.

The name of a directory that contains a meta.json template information file and exists within one of the following directories:

  • /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/etc/site_templates/ — cPanel-provided templates in cPanel & WHM version 56 through 68.
  • /usr/local/cpanel/3rdparty/share/site_templates/ — cPanel-provided templates in cPanel & WHM version 70 and later.

Note:

The template directory's location depends on whether the root user or a reseller owns the template.

about_me