Jupiter Theme - Creating a Custom Home Button while keeping the session in the URL

kumiyare

Registered
Nov 21, 2013
2
0
51
cPanel Access Level
Root Administrator
Hi,

I am customizing the new cPanel Jupiter theme, and so far I have had few successes, I would like to add a new home button via 'Content Includes',

For Example: <a href="cPanel-Base-URL/index.html"> Go Back Home </a>

Desirable output: <a href="https://example.com:2083/cpsessxxxxxxxxxx/frontend/jupiter/index.html"> Go Back Home </a>

How can I get the cPanel Base URL? or do you know any alternative way to achieve this while keeping the session identifier in the URL?

Thank you
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,163
2,410
363
cPanel Access Level
Root Administrator
Hey there! We have an API tool that will create a user session based off your currently logged in session:


Is that what you're looking for?
 

kumiyare

Registered
Nov 21, 2013
2
0
51
cPanel Access Level
Root Administrator
Hey there! We have an API tool that will create a user session based off your currently logged in session:


Is that what you're looking for?
Thank you for the quick reply cPRex,

I think the solution you posted is related to WebMail, I am currently customizing the front-end cPanel via 'Content Includes'.

After a lot of googling, I decided to code it myself and I have achieved what I was looking for with JavaScript.

First by grabbing the full, current URL, then splitting the URL into segments, and then reconstructing the segments into the desired URL.

Below is my code:

YOU CAN CLICK THIS LINK TO SEE THE JAVASCRIPT CODE:

HMTL:
<a href="#" id="cPanelBaseLink"> Go Back Home </a>

SAMPLE OUTPUT:
<a href="https://example.com:2083/cpsessxxxxxxxxxx/frontend/jupiter/index.html"> Go Back Home </a>

if anyone have a better, simpler or cleaner way to do it, can you please share it here with us.

Thank you
 

Attachments