Jump to content

Nav Links


Recommended Posts

Couldn't figure out how to reply in an already created topic of the community.  Doesn't surprise me in the least.  Had this problem a month ago.  Here it is again.  It works for a little while then it doesn't.  I get a server error.  Below is the link I want it to go to, however it does not.  It leaves the php off.  So how can I get this going?

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
    $navItem = $primaryNavbar->getChild('Support');
    if (is_null($navItem)) {
        return;
    }

    $navItem = $navItem->getChild('Announcements');
    if (is_null($navItem)) {
        return;
    }

    $navItem->setUri('https://hostingpoint24.com/clients/announcements.php');

});

Link to comment
Share on other sites

10 hours ago, socialpoint24 said:

However, why is it so hard to change the font awesome icons?

is it hard? you just need to use setIcon...

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function(MenuItem $PrimaryNavbar)
{
	if(!is_null($PrimaryNavbar->getChild('Store'))){
		$PrimaryNavbar->getChild('Store')
				->setIcon('fa-shopping-cart');
	}
});

Sr8cRJO.png

in your example, you could set it at the same time as setting the URL path.

Link to comment
Share on other sites

I'm trying to change the font icons in Homepage panels. I've tried several codes and they all aren't working.

<?php

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)
{
    
    $homePagePanels->getChild('Recent Support Tickets', array(
        'icon' => 'fa fa-ticket',
        ));
        
       
   
});

Here's the one that isn't working right now.  I can't think of the others I've used.  I must have the array as well or it's a no go.


 
Link to comment
Share on other sites

16 hours ago, socialpoint24 said:

I must have the array as well or it's a no go.

you could use the array like that with an addChild...

have you tried just using setIcon... ?

ignore the above hook being a navbar, it would work the same way with homepagepanels too.

Link to comment
Share on other sites

just as a quick followup to this, I double-checked this today (I was on my way out of the office when I posted previously) and setIcon is the way to go to change the icon of an existing panel.

<?php

# HomePagePanel Hook
# Written by brian!

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function(Item $homePagePanels) {
	
	if(!is_null($homePagePanels->getChild('Recent Support Tickets'))){
				$homePagePanels->getChild('Recent Support Tickets')
						->setIcon('fa-ticket');
	}
});

A7hAVQ6.png

Link to comment
Share on other sites

  • 1 month later...

Now I'm trying to set the icons on the Secondary Sidebar & I've had no luck...   https://hostingpoint24.com/clients/cart.php?gid=6

I can't add an icon to the Categories Panel Menu Items like Website Hosting nor can I change the Icons in the Actions Panel.

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecodarySidebar', 1, function(MenuItem $secondarySidebar) {
     
     if (!is_null($secondarySidebar->getChild('Actions'))) {
             $secondarySidebar->getChild('Domain_Transfer')
                           ->setIcon('fas fa-exchange-alt');
   }

});
 

Link to comment
Share on other sites

never mind.  I found the right code.

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $SecondarySidebar)
{
    if(!is_null($SecondarySidebar->getChild('Actions'))){
        $SecondarySidebar->getChild('Actions')
                ->getChild('Domain Transfer')
                ->setIcon('fas fa-exchange-alt');
    }
});  

 

Link to comment
Share on other sites

 

But I am having trouble with icons again.....https://hostingpoint24.com/clients/clientarea.php  Neither are working...

 

<?php

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomePagePanels', 1, function(Item $homePagePanels) {
    
    if(!is_null($homePagePanels->getChild('kopage'))){
                $homePagePanels->getChild('kopage')
                        ->setIcon('fas fa-desktop');
    }
});

 

<?php

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function(Item $homePagePanels) {
    
    if(!is_null($homePagePanels->getChild('kopage'))){
                $homePagePanels->getChild('kopage')
                            ->getChild('kopage2')
                               
                        ->setIcon('fas fa-video');
    }
});

Link to comment
Share on other sites

14 hours ago, socialpoint24 said:

But I am having trouble with icons again... Neither are working...

the first looks correct (and works locally if I change the childname); the second definitely looks wrong to me.

are you sure than you have a panel with the name of 'kopage' ?

 

Link to comment
Share on other sites

Yes if you go to that page I have a website builder that uses the Kopage module.  I came up with these but still doesn't work.

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
    if(!is_null($primarySidebar->getChild('kopageMenuItemName'))){
        $primarySidebar->getChild('kopageMenuItemName')
                
                ->setIcon('fas fa-desktop');
    }
});  

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
    if(!is_null($primarySidebar->getChild('kopageMenuItemName'))){
        $primarySidebar->getChild('kopageMenuItemName')
                ->getChild('kopageSubMenuItemName2')
                ->setIcon('fas fa-video');
    }
});  
 

Link to comment
Share on other sites

3 minutes ago, socialpoint24 said:

Yes if you go to that page I have a website builder that uses the Kopage module. 

the problem is I can't - it's the client area and i'd need to login.

is this a sidebar or a panel... your posting all sorts of different hooks and i've lost track of what you're trying to do. 😃

can you post a screenshot of the panel or sidebar, along with the source code from the browser (not the hook) for that panel/sidebar.

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