UAPI Functions - Styles::list

Description

This function lists information about reseller account's available styles.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Styles/list

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List styles available to reseller account.
$list_reseller_styles $cpanel->uapi(
    'Styles''list'
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List styles available to reseller account.
my $list_reseller_styles $cpliveapi->uapi(
    'Styles''list',
);

 cPanel Template Toolkit

<!-- Display all the attributes for each of the styles that come back. -->
[% data = execute( 'Styles', 'list' ).data; %]
[% FOREACH q = data %]
    <p>
        <br>Name: [% q.name %]</br>
        <br>Type: [% q.type %]</br>
        <br>Display Name: [% q.display_name %]</br>
        <br>Preview: [% q.preview %]</br>
    </p>
[% END %]

 Command Line

uapi --user=username Styles list

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
    "transformed": 1
  },
  "data": [
    {
      "preview": 1,
      "name": "basic",
      "type": "default",
      "display_name": "Basic"
    },
    {
      "preview": 0,
      "name": "example",
      "type": "reseller",
      "display_name": "Example"
    },
    {
      "preview": 1,
      "name": "another",
      "type": "global",
      "display_name": "Global Theme"
    }
  ]
}

 

Note:

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

 

Parameters

This function does not accept parameters.

Returns

Return

Type

Description

Possible values

 Example 

type

string

The style type.

  • default
  • global
  • reseller
  • user

default

name

string

The folder that contains the style.

A filename.

basic

preview

 Boolean 

 Whether the style contains a preview image. 

  • 1 — Present.
  • 0 — Absent.

1

 display_name 

string

The style name.

A style name.

 The style's directory name determines this name. 

Basic

selected

Boolean

Whether the style is the current style.

  • 1 — The current style.
  • 0 — Not the current style.

1

default

Boolean

Whether the style is the default style.

  • 1 — The default style.
  • 0 — Not the default style.

1

 

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