Jump to content

Change icon associated with the login button under "Already Registered?" sidebar


Recommended Posts

Hello,

I would like to change the icon associated with the login button under the "Already Registered?" sidebar. I've been searching high and low inspecting the files but I have not been able to find the location where the "fa fa-user" icon is set as the icon for that login button.

I have found the section in the sidebar.tpl file where it has this

{if $childItem->hasIcon()}<i class="{$childItem->getIcon()}"></i> {/if}

However I am having trouble finding from which file it is getting that information from. Any help would be greatly appreciated!

 

kind regards

already registered icon.png

Link to comment
Share on other sites

  • 2 months later...

Did you ever manage to change the icon ? It's set by WHMCS

If you didn't figure it out here's a way you can do it. 

image.png.6d40cf974ac995d7d435d852574b6978.png

Create a Hook file in /WHMCS_DIR/includes/hooks/, 

e.g. myHook.php

Inside it add this code:

<?php
use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
  $primarySidebar->getChild('Already Registered')
    ->getChild('Login')
    ->setIcon('fa-server');
});

Then where you see fa-server change to the font-awesome icon that you wish to use :)

There's more you can change & you can remove menu items too checkout the https://developers.whmcs.com/themes/sidebars/

Link to comment
Share on other sites

12 hours ago, TomoTech said:

Inside it add this code:

that code won't work... or to be more precise, it will but only when that sidebar exists (e.g on the register.php page) - on any other page, where it doesn't exist, you'll get an Oops error message. naughty.gif

so, before modifying a sidebar/navbar, you always need to first check that it exists...

<?php
use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
	if (!is_null($primarySidebar->getChild('Already Registered')))
		$primarySidebar->getChild('Already Registered')
				->getChild('Login')
				->setIcon('fa-server');
});
12 hours ago, TomoTech said:

There's more you can change & you can remove menu items too checkout the https://developers.whmcs.com/themes/sidebars/

btw - you shouldn't necessarily believe the official documentation on this to be 100% accurate. :idea:

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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