1

From my templates, I want to link to my CPanel. The template is only accessible by those who do have permission to access the CPanel. How do I link to the CPanel from the template? The URL I see generated when I log in seems to include a session id.

1
  • to what pages you want to make links?
    – Max Lazar
    Sep 25 '14 at 10:39
4

Starting from version 2.8.0 you can use standard global variable for this

{cp_session_id}

if you want to make link to edit entry, don't forget about special tag for this which available from version 2.9.0

{cp_edit_entry_url} 

You can also output the cp main url (like example.com/admin.php) using global variable (from ee 2.8.0)

{cp_url}
2
  • So what is the URL? Do I have to build it, adding the session id in the query string? Sep 25 '14 at 12:02
  • 1
    URL to what? You still don't tell what page you need. If entry - <a href="{cp_edit_entry_url}">Edit Entry</a>. If some other page - copy url from CP, replace session_id with tag + you can replace main cp url with {cp_url}. Or you just want url to CP at is?
    – Max Lazar
    Sep 25 '14 at 12:17
0

You can get the session id via PHP by using

$this->EE->session->userdata['session_id'] 

You are probably best wrapping this in a plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.