ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

CP login url?

February 02, 2012 11:01am

Subscribe [4]
  • #1 / Feb 02, 2012 11:01am

    stevo_s

    176 posts

    Is there an example of EE code if creating a link to the control panel to put in a template? or do you just have to hardcode it?

    so if logged in - show CP Home link.

    Can only find one that links to profiles, which I don’t use.

  • #2 / Feb 03, 2012 5:27pm

    Dan Decker

    7338 posts

    Hi stevo_s,

    There isn’t a pre-set variable for it, but you could assign the link to a global variable and then call that in your template based on member level. If you are using admin.php you can use this in your template as well:

    {site_url}admin.php

    Cheers,

  • #3 / Feb 03, 2012 5:48pm

    Andrew Fairlie's avatar

    Andrew Fairlie

    126 posts

    If you’re using it in multiple contexts I would set it as a snippet which is just :-

    <a href="http://{site_url}admin.php">Control Panel</a>

    You could alternatively make it a Global Variable of:-

    <a href="/admin.php">Control Panel</a>

    But if you were to implement the GV across 5 templates and then realise you need to use EE code it’d be a mess, so may as well jump right into Snippets for this. In addition it only works in a neat way if you’re admin is on the top level of the domain.

    Of course if you’re only using the link in a global footer template, you may stick it directly into the template.

  • #4 / Feb 04, 2012 6:11am

    stevo_s

    176 posts

    Great thanks.

  • #5 / Feb 04, 2012 7:24am

    stevo_s

    176 posts

    BTW I created another topic on this, but is it secure to allow access to the admin login url anyway?
    And is it best to change it to admin673.php or something?

  • #6 / Feb 04, 2012 10:10am

    Boyink!'s avatar

    Boyink!

    5011 posts

  • #7 / Feb 04, 2012 12:07pm

    stevo_s

    176 posts

    Thanks Boyink! hadn’t seen that one before.

     

  • #8 / Feb 04, 2012 12:28pm

    Shane Eckert's avatar

    Shane Eckert

    7174 posts

    Hi stevo_s,

    Thanks to Mike!

    It looks like you are all sorted now.

    Thanks you for using the forums!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases