Jump to content

Six theme questions


djpete

Recommended Posts

I am not familiar with hooks although I managed to add a few tests from your examples.

But I am not using Six until there is more info and cheats for this.

I went through all the documentation but could not find a hook to add a simple main menu item to the client area. It showed me how to add a submenu but not a main menu item.

 

Also if I use six can I remove or disable the client shortcuts entirely to cpanel as I really don't want my customers getting in there.

 

thanks.

 

I do like the more refined cleaner look of the admin area. Best it's ever looked

Link to comment
Share on other sites

This will add a new menu to navbar only viewable by logged in customers.

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   $client = Menu::context('client');

   if (!is_null($client)) {
       $primaryNavbar->addChild('Example')
           ->setUri('https://www.example.com/')
           ->setOrder(100);
   }
});

 

Just add this to a hook file.

 

 

And for the new cpanel sign on feature here is the docs .

 

http://docs.whmcs.com/CPanel_Single_Sign-On

Edited by lee-wservices
Link to comment
Share on other sites

almost there..

http://www.hostingwebdesign.com.au/customerportal/index.php

 

and if i want to remove some buttons in the main nav?

 

- - - Updated - - -

 

This worked for me..

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   $client = Menu::context('client');

{
       $primaryNavbar->addChild('Main Website')
           ->setUri('http://www.hostingwebdesign.com.au/')
           ->setOrder(1);
   }
});

Link to comment
Share on other sites

yep saw that but it removes a submenu item.

I need to remove a main menu item.

 

I go this to work but I would like the code correct please..

 

<?php

 

use WHMCS\View\Menu\Item as MenuItem;

 

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

{

if (!is_null($primaryNavbar->removeChild('Open Ticket'))) {

 

}

});

Link to comment
Share on other sites

added this.

broke it..

 

<?php

 

add_hook('ClientAreaNavbars', 1, function ()

{

// Save the "Contact Us" link and remove it from the primary navigation bar.

$contactUsLink = $primaryNavbar->getChild('Announcements');

$primaryNavbar->removeChild('Announcements');

});

Link to comment
Share on other sites

well I have decided to leave the Announcement link anyway.

 

Can someone double check this code though?

I just want to make sure it is 100% correct.

It does work but I made it so want to make sure it's right.

 

<?php

 

use WHMCS\View\Menu\Item as MenuItem;

 

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

{

if (!is_null($primaryNavbar->removeChild('Open Ticket'))) {

 

}

});

Link to comment
Share on other sites

it was very late at night, so I was being less helpful than usual! smiley-sleep002.gif

 

to remove an item from the navbar, you could use the following...

 

<?php

add_hook('ClientAreaNavbars', 1, function ()
{
   // Get the current navigation bars.
   $primaryNavbar = Menu::primaryNavbar();
   $primaryNavbar->removeChild('Announcements');
});

Link to comment
Share on other sites

thank you. I decided to use the Announcements page now.

 

Does this look ok to you?

It works but just want the code right..

 

<?php

 

use WHMCS\View\Menu\Item as MenuItem;

 

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

{

if (!is_null($primaryNavbar->removeChild('Open Ticket'))) {

 

}

});

 

- - - Updated - - -

 

and here's the end result with quite a few tweaks..

http://www.hostingwebdesign.com.au/customerportal/index.php

Link to comment
Share on other sites

I know this s probably a really dumb question but I have to ask this. I used the Social Media example and successfully created a hook and menu for it.

 

I attempted to create another Sub menu in our Services but I have no idea what to name the php file in the hooks directory. The doc reference hooks but what to name the file?

 

Whenever I create a hook file (*php) and add the example code The client area page is blank. When I remove the php file the page properly displays.

Edited by rodeoXtreme
Link to comment
Share on other sites

Maybe its me, but dont you think that menu manipulation should be when it comes to theming (not module based) should be in the templates? I understand that moduels should be able to modify menus as well, but I think there should be able to be hooks within template folders as well if thats how you expect menus to be modified.

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