So for a simple internally-used page I’ve gotta create an admin page, and I want to do it propperly.
I’ve got one problem with linking to said admin pages.
<?php echo $this->Html->link("Blogposts",array('controller'=>'pages','action'=>'home')); ?>
<?php echo $this->Html->link("Administration",array('controller'=>'blogposts','action'=>'index','admin'=>true)); ?>
So: the first link should always go to the main page with blogposts.
The second link should go to the administration area for said blogposts.
This works fine. But when I am in the admin area, and I click the top link again, it’ll fail. It’ll still prepend the “/admin/” path to the url.
When I add 'admin' => false to the first link it works again, but I don’t know if that is “best practice” or not.
It is. Any links in an admin area that you want to go to a non-admin area, should have
'admin'=>false.