Does anyone know how to customize the end-user's tabs when they are logged in? If so, which specific file(s) is it & where is it located? Wish we had a manual for V4...
Tabs/Customizations The way I did it: Create a new module in the application folder. Create the files Bootstrap.php and module.xml (or copy and edit them from another module) Enable the module in Admin/Config. Then you can do something like this, in Bootstrap. PHP: class Bootstrap_MyModule extends Am_Module { function onUserMenu(Am_Event $event) { // $user = $event->getUser(); // if required $menu = $event->getMenu(); // eg; add a tab $menu->addPage(array( 'id' => 'mypage', 'label' => ___('Do The Thing'), 'uri' => '/the.thing', 'order' => 2, )); // remove a page $page = $menu->findOneBy('id', 'add-renew'); $menu->removePage($page); } onUserMenu is all fairly Zend framework stuff. I also define new Blocks for the members 'dashboard' in the module, and also some customised views/templates. The helpdesk module is a good place to look.
As a follow-up, Alex suggested this code and it works for adding tabs Code: $this->addPage(array( 'id' => 'users', 'uri' => 'http://mysite.com/xx', 'label' => 'My Label'));
Hi, I tried this and it does what it says, but It keeps just replacing the tab 'add/renew subscription' I have changed the order to 6 or another number, just want it to appear on the end after helpdesk or add in to another area. Also for 'id' what do I put in here? Thanks, Dan
I actually got it it to add a tab now by deleting the last part, but I still cant put it in the order I want.
Add this at the bottom of your tab. The 300 is the order of the tabs appearance. PHP: 'order' => 300,
Another way to do the same from application/configs/site.php PHP: <?phpAm_Di::getInstance()->hook->add('userMenu', 'siteUserMenu');function siteUserMenu(Am_Event $event){ // $user = $event->getUser(); // if required $menu = $event->getMenu(); // eg; add a tab $menu->addPage(array( 'id' => 'mypage', 'label' => ___('Do The Thing'), 'uri' => '/the.thing', 'order' => 2, )); // remove a page $page = $menu->findOneBy('id', 'add-renew'); $menu->removePage($page);}
Hi Alex, I've done as you suggested, but nothing changes. In the directory application/configs/ I renamed site-dist.php to site.php and put mentioned code there. No new tabs appeared in the users inteface. Did I missed something?