Adding Dashboard Tabs / Pages When Package is Installed

Permalink 1 user found helpful
Hi,

How can I add a tab/page to someone's dashboard when they install my addon (package)?

I saw this post, but was still confused:http://www.concrete5.org/community/forums/customizing_c5/creating-d...

Thank you.

celwell
 
jgarcia replied on at Permalink Best Answer Reply
jgarcia
Do this in the install function of your package controller:

$pkg = parent::install();
Loader::model('single_page');
$mySinglePage = SinglePage::add(/dashboard/newpage'),$pkg);
$mySinglePage->update(array('cName' => 'My Page Name', 'cDescription' => 'Description of the page'));


Of course, you would need to have the view and controller of this page in the appropriate place. /{your-package-name}/single_pages/dashboard/newpage.php for the view and /{your-package-name}/controllers/dashboard/newpage.php for the controller.