Need to add new tab in dashboard
Loader::model('single_page'); $sp = SinglePage::add('dashboard/newpage'); $sp->update(array('cName'=>t('Title goes here'), 'cDescription'=>t('Description goes here.')));
you should create php file before that:
The above example will add button to left side menu with title 'Title goes here' and description 'Description goes here', the url will be .../dashnoard/newpage
To add items to top menu, you'll have to create single pages of the third level:
I hope it helps.
This is similar to what I was wanting to achieve however I want the new tab to link to a second web app installed on my server, not link to a page inside the dashboard, firstly is this even possible, secondly could some one give me some pointers please? I am new to all this and didn't follow exactly how the above response works.
Have a couple of problems here and I think it's because I'm not quite following.
1./ I have created a blank php file placed in root_dir/single_pages/dashboard/ and called it invoices.php and inside this php file I have placed:
$sp = SinglePage::add('dashboard/Invoices');
$sp->update(array('cName'=>t('Client Invoices'), 'cDescription'=>t('View client invoices.')));?>
This does add a new button to the dashboard titled Invoices however my first problem is that the title of the button is marked as "Client Invoices", it seems to only place the title of the php file and no description.
2./ on the same issue, where do I place the redirect code placed by "Tbvrowe"? Do I place:
inside the invoices.php file or do I need to create a controller.php as well?
I am sorry guys, I am very new to PHP and am trying to learn by throwing myself in the deep end "WITH MUCH APPRECIATED SUPPORT FROM THE C5 COMMUNITY".
Thank you sooo much to anyone that takes a glance at this.
At line 85 you will find the links to the top menu bar. Here just copy an LI and add a new one to your link. I for instance use this to add an external link to expose flash gallery admin panel, since I can't find a good gallery for CC5.
Also if you scroll down to line 96 you will see the nav in the theme file. Just find the a href code and copy that before all the php to make your own link without the need for creating a whole new page. Good luck :)
Create a page in folder single_pages/dashboard/somepagename.php
Now in the dashboard, in Pages and Themes add a new Single page. At the bottom of this page you will enter the URL
It needs to match the folder directory, so you will enter
Now for controllers and models your options are endless :)
See this how to for more