UAPI Functions - Branding::include

Description

This function retrieves another file's contents for display.

Warning:

This function is for the x3 theme only. You cannot call it successfully from the Paper Lantern theme. Because of this, we strongly recommend that you do not use this function.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Branding/include?file=dynamiccontent.html&skipdefault=0&raw=0

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Display dynamiccontent.html's contents.
$include_path $cpanel->uapi(
    'Branding''include',
    array(
      'file'          => 'dynamiccontent.html',
      'skipdefault'   => '0',
      'raw'           => '0',
    )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Display dynamiccontent.html's contents.
my $include_path $cpliveapi->uapi(
    'Branding''include',
    {
      'file'          => 'dynamiccontent.html',
      'skipdefault'   => '0',
      'raw'           => '0',
    }
);

 cPanel Template Toolkit

<!-- Get the include URL. -->
[% execute('Branding', 'include', { 'file' => 'dynamiccontent.html', 'skipdefault' => '0', 'raw' => '0', } ) %]

 Command Line

uapi user=username Branding include file=dynamiccontent.html skipdefault=0 raw=0 

 

Notes:

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

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
 
   },
   "data":"My file's contents.\n"
}

 

Note:

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

 

Parameters

Parameter

Type

Description

Possible values

Example

file

string

Required

The file.

A file path, relative to the/usr/local/cpanel/base/appname/theme/brandingdirectory, where:

  • appname is webmail if the caller authenticated through Webmail, or frontend if the caller authenticated through cPanel. 
  • theme is the user's theme (x3).

 dynamiccontent.html 

 skip_default 

 Boolean 

 Whether to search only custom themes. 

This parameter defaults to 0.

  • 1 — Search only custom themes.
  • 0 — Search cPanel's default themes.

0

raw

Boolean

Whether to process the file's contents.

This parameter defaults to 0. 

  • 0 — Process the file's contents.
  • 1 — Display the file's raw contents.

0

 

Returns

 Return 

Type

Description

Possible values

Example

data

 string 

 The file's contents. 

 The full contents of the file parameter's file. 

 My file's contents.\n 

 

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