Krydos

Well-Known Member
Jun 2, 2012
59
9
58
cPanel Access Level
Root Administrator

Krydos

Well-Known Member
Jun 2, 2012
59
9
58
cPanel Access Level
Root Administrator
Here is how I do the header in x3:
Code:
require_once "/usr/local/cpanel/php/cpanel.php";
$cpanel = new CPANEL();

$res = $cpanel->api1("Branding", "include", array("stdheader.html"));
print $res["cpanelresult"]["data"]["result"];
I've tried that with paper_lantern and it sort of works, but some images are missing and it doesn't look quite right. Any ideas?
 

Krydos

Well-Known Member
Jun 2, 2012
59
9
58
cPanel Access Level
Root Administrator
Since no one wanted to help me on this one I found a way to do what I was trying to do on my own. This is probably a pretty ugly hack, but it works.

First I copied and split paper_lantern/branding/master.tt into two new files paper_lantern/branding/header.tt and paper_lantern/branding/footer.tt The header.tt file has everything from master.tt up until the tag.
Code:
[%- content -%]
This tag indicates where the content of the page should be inserted into the paper_lantern themed page. Then the footer.tt file gets the contents of master.tt after that content tag.

So then I created my new plugin index page such as paper_lantern/myplugin/index.phpcp It's important to use the phpcp extension at this point because when I tried this with .live.php extension it didn't work. Now to include the new header.tt file at the top and the footer.tt file at the bottom use this code.

Code:
<cpanel Branding="include(header.tt)">

<?php
echo "Hello world!";
?>

<cpanel Branding="include(footer.tt)">
This is the only way I've been able to create a properly branded paper_lantern themed page in cpanel 11.44. Feel free to post to this thread if you know of another way.

EDIT:

You will also need to edit the header.tt file and change this line from
Code:
SET directory_prefix = CPANEL.CPVAR.dprefix;
to
Code:
SET directory_prefix = '../';
in order for the header and footer links to work properly.
 
Last edited:

Krydos

Well-Known Member
Jun 2, 2012
59
9
58
cPanel Access Level
Root Administrator
11.44 is the last version you can update to with the old /usr/ size recommendations. To upgrade beyond this version requires three times as much free space on /usr/ as previous cpanel versions. All of our newer servers which have a lot more free space on /usr/ because of the newer partition size recommendations are running the latest version of cpanel, but a couple older servers are unable to upgrade any further. Our plan is to get all of the user accounts moved off the old servers and then repartition the hard drives then they will be able to run the latest cpanel versions too.