Jump to content

Edit the Menu Items in V6 Templates


hpk

Recommended Posts

Hello again,

 

Does anyone know how to change the menu items in the V6 templates? I need to include some custom menu items and change link for the 'Home' page. However I am unable to find any setting within whmcs or in the template file itself.

 

Please guide.

 

Regards,

Israr

Link to comment
Share on other sites

The menu's are now controlled via Hooks. Start off here http://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet

 

Here is my menu.php hook file as an example;

 

 

 

 

<?php

 

$ca = new WHMCS_ClientArea();

 

use WHMCS\View\Menu\Item as MenuItem;

 

/** If the user is logged in.**/

 

if ($ca->isLoggedIn()) {

 

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)

 

{

/** Rename the "Home" menu item. **/

$primaryNavbar->getChild('Home')

->setLabel('Account Overview');

 

/** Remove unwanted menu items from the support menu **/

$primaryNavbar->getChild('Support')

->removeChild('Announcements')

->removeChild('Downloads');

 

/** Change the URL of the knowledgebase to point at Zendesk **/

 

$primaryNavbar->getChild('Support')

->getChild('Knowledgebase')

->setUri('https://support.thetechlounge.co.uk');

 

 

/** Add CSF Manager to the Support Menu **/

$primaryNavbar->getChild('Support')

->addChild('Firewall Management', array(

'label' => 'Manage Firewall',

'uri' => 'index.php?m=csfmanager',

'order' => '1',

));

});

}

 

/** If the user isn't logged in. **/

 

else {

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)

{

$primaryNavbar->getChild('Home')

->setLabel('Account Overview');

});

 

}

Edited by TheTechLounge
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated