Link to panel for to login

I would like to add a link in the menu for users to log in. Like a button. I can hardcode the url but since I work locally and then push it up, I don’t want to change the url manually. I would like to do it - programmatically (is this the word?).

Something like

<a href="<?= $site->url()/panel ?>"Login</a>

Doesn’t work.

I can’t find any hint for that in the docs.

<?= $site->panelUrl() ?>

Will bring you to the Dashboard (if user is already logged in) or the Panel login if not (in the same way, you can use $page->panelUrl() to go directly to a given page (you will also end up on the login page if not logged in).

Not telling everyone that there is a login form and even hiding it behind a more obscure URL might be an additional security feature.

Thank you!

That hiding feature is cool!

But, where or how could I have found that myself in the docs?

You will see in results.

1 Like

If you know what you are looking for, that is :wink:

Yes, but useless if you link to it in your menu.

1 Like

I did use the search - heavily, but I didn’t know “PanelURL” as a search term. I used “link to panel” or “login link” or “how to link to the panel” and stuff like that. And also for the forum.