Description

This function lists information for the cPanel account's Site Publisher websites.


To retrieve the list of Site Publisher website information, the function queries the configurations.json file in each domain's document root. For more information, read our Guide to Site Publisher Templates documentation.

Examples 




https://hostname.example.com:2083/cpsess##########/execute/SiteTemplates/list_user_settings



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List information for the account's Site Publisher websites.
$templates = $cpanel->uapi(
    'SiteTemplates', 'list_user_settings'
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List information for the account's Site Publisher websites.
my $templates = $cpliveapi->uapi(
    'SiteTemplates', 'list_user_settings',
);

 



<!-- List the account's backup files. -->
[% data = execute( 'SiteTemplates', 'list_user_settings' ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 



uapi --user=username SiteTemplates list_user_settings



{  
   "status":1,
   "errors":null,
   "messages":null,
   "data":[  
      {  
         "template_settings":{  
            "is_empty":0,
            "path":"/var/cpanel/customizations/site_templates",
            "template":"mytemplate"
         },
         "homedir":"/home/example",
         "documentroot":"/home/example/public_html",
         "serveralias":[  
            "www.example.com"
         ],
         "type":"main_domain",
         "domain":"example.com"
      }
   ],
   "metadata":{  
      "transformed":1
   }
}



Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
 hash

An unnamed hash of each domain's site template information.

This hash includes the homedir, documentroot, type, and domain returns, the serveralias array, and the template_settings hash.

 

template_settings

hash

A hash of template settings.

The function returns this hash in the unnamed hash.

This hash includes the is_empty, path, and template returns.

This hash also contains the user's website content. The template provider determines these values.

  • For information about the content for cPanel-provided templates, read our Guide to Site Publisher Templates documentation.
  • For more information about other templates, contact the template provider.


 

is_empty

Boolean

Whether the domain's configurations.json file exists and contains template information.

The function returns this value in the template_settings hash.

  • 1 — The configurations.json file exists and contains template information.
  • 0 — The configurations.json file does not exist, or does not contain template information.
0

path

string

The template directory path.

The function returns this value in the template_settings hash.


/var/cpanel/customizations/site_templates


template

string

The template's name.

The function returns this value in the template_settings hash.

The name of a template, as it appears in the configurations.json file.

mytemplate

homedir

string

The user's home directory.

The function returns this value in the unnamed hash.

The absolute path to the cPanel account's home directory./home/example

documentroot

string

The domain's document root.

The function returns this value in the unnamed hash.

The absolute path to the directory's document root inside of the account's home directory./home/example/public_html

serveralias

array

An array of the domain's aliases.

The function returns this array in the unnamed hash.

An array of one or more of the domain's aliases.www.example.com

type

string

The domain's type.

The function returns this value in the unnamed hash.

  • main — The main domain.
  • sub — A subdomain.
main

domain

string

The domain name.

The function returns this value in the unnamed hash.

A valid domain name.example.com