This function lists available templates for cPanel's Site Publisher feature.
root or system user, the function lists the root user's templates.root user's templates and the reseller's templates.root user owns the account, the function only lists the root user's templates.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/3rdparty/share/site_templates/ — cPanel-provided templates.Important:
When you disable the Web Server role, the system disables this function.
uapi --output=jsonpretty \ --user=username \ SiteTemplates \ list_site_templates
{- "apiversion": 3,
- "func": "list_site_templates",
- "module": "SiteTemplates",
- "result": {
- "data": [
- {
- "meta": {
- "fields": [
- {
- "id": "fullName",
- "label": "Full Name",
- "placeholder": "Your Name",
- "type": "text"
}
], - "information": {
- "date": "2020-06-30T00:00:00.000Z",
- "description": "Single page 'About Me' site",
- "id": "about_me",
- "name": "About Me",
- "preview_image_path": "/preview.png"
}
}, - "path": "/usr/local/cpanel/3rdparty/share/site_templates",
- "preview": 1,
- "template": "about_me"
}
], - "errors": null,
- "messages": null,
- "metadata": {
- "transformed": 1
}, - "status": 1,
- "warnings": null
}
}