Jump to content

How To: Customise Default Six Theme


KyleJ144

Recommended Posts

Hey,

 

I am trying to customise the navigation bar and i cannot understand the code and if i change the code then the full navigation bar messes up. I have enclosed screenshots of the navigation bar and a file containing the code as i want to change store so "Web Hosting". The code on the file that i have enclosed is different to what i am getting if i go into the page source (Also screenshot) enclosed).

 

Any help would be appreciated and thank you in advance.

code.png

navbar.tpl

nav.png

Link to comment
Share on other sites

12 hours ago, KyleJ144 said:

I am trying to customise the navigation bar and i cannot understand the code and if i change the code then the full navigation bar messes up.

in order to change the navbar, there is no need to edit the navbar.tpl template - the navbar menu can be modified using hooks.

https://docs.whmcs.com/Editing_Client_Area_Menus

https://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet

however in your case, if you just want to change the label of a default navbar menu item, you can use Language Overrides to do this.

e.g for English, you would create an "overrides" folder in /lang and then create an english.php file within it (do not edit the existing english.php file already in /lang)...

<?php
$_LANG['navStore'] = "Web Hosting";

SI6XF0K.png

and then repeat for the other languages used in your WHMCS website.

alternatively, if you wanted to do this using an action hook, and wished to make it say "Web Hosting" for all languages, you could create a .php file in /includes/hooks, give it a filename and paste the following into it.

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
	if (!is_null($primaryNavbar->getChild('Store'))) {
            $primaryNavbar->getChild('Store')
			->setLabel('Web Hosting');
	}
});

 

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