graisbeck Posted May 10, 2017 Share Posted May 10, 2017 (edited) Hi, I can add a menu item to the primary and secondary navbars no problem (thanks to brian!), but how do I add a menu item to the "how can we help today" navigation? I've already created my SSL products which automatically show in the sidebar navigation, but I want the link to be available from the homepage too. Any help would be greatly appreciated! Edited May 11, 2017 by graisbeck 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 11, 2017 Share Posted May 11, 2017 to do that you need to go old skool and edit a template! if you take a look in header.tpl, you see the following code... <div class="home-shortcuts"> that entire block of code controls the menu that you're talking about - so you'll need to add your link in there. 0 Quote Link to comment Share on other sites More sharing options...
graisbeck Posted May 11, 2017 Author Share Posted May 11, 2017 to do that you need to go old skool and edit a template! if you take a look in header.tpl, you see the following code... <div class="home-shortcuts"> that entire block of code controls the menu that you're talking about - so you'll need to add your link in there. Hi brian!, I've got the link working (as image shows)but I don't understand how the ID (id="btnOrderHosting") works, so I have used the same ID as the hosting link and copied the url as used in the sidebar menu to link the page, as below. I feel sure you will correct me on this <li> <a id="btnOrderHosting" href="cart.php?gid=2"> <i class="fa fa-lock" aria-hidden="true"></i> <p> {$LANG.sslcerts} <span>»</span> </p> </a> </li> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 11, 2017 Share Posted May 11, 2017 I've got the link working (as image shows).... what image! but I don't understand how the ID (id="btnOrderHosting") works, so I have used the same ID as the hosting link and copied the url as used in the sidebar menu to link the page, as below. I feel sure you will correct me on this IDs should always be unique... the world won't end because it doesn't have one, but ideally you should give it a unique ID - it won't matter what. 0 Quote Link to comment Share on other sites More sharing options...
graisbeck Posted May 11, 2017 Author Share Posted May 11, 2017 what image! IDs should always be unique... the world won't end because it doesn't have one, but ideally you should give it a unique ID - it won't matter what. Sorry brian image attached. So does the unique ID actually process anything? I know it has it's uses in HTML and CSS etc, but I couldn't work out why it is included. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 11, 2017 Share Posted May 11, 2017 So does the unique ID actually process anything? I know it has it's uses in HTML and CSS etc, but I couldn't work out why it is included. I think it's included so that you have the option to reference it directly - but you can do that whatever the ID is called... I doubt it will be bestowed with any magical powers and there aren't any specific references to them in the css files. 0 Quote Link to comment Share on other sites More sharing options...
graisbeck Posted May 11, 2017 Author Share Posted May 11, 2017 Thanks brian! I also meant to ask - how do I add fa icons to the sidebar navigation menu items? I've looked in sidebar.tpl, includes/hooks and sidebar cheatsheet, but couldn't find the actual links. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 11, 2017 Share Posted May 11, 2017 graisbeck said: Thanks brian! I also meant to ask - how do I add fa icons to the sidebar navigation menu items? I've looked in sidebar.tpl, includes/hooks and sidebar cheatsheet, but couldn't find the actual links. for the sake of argument, i'm going to assume it's an existing sidebar with children - if it were a new sidebar/child, then you could just add 'icon' => 'fa-circle' to the creating array (as shown in the documentation). but let's take the categories sidebar as an example - this is what it might look like by default... a little drab, but we can add icons using the following hook... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $SecondarySidebar) { if(!is_null($SecondarySidebar->getChild('Categories'))){ $SecondarySidebar->getChild('Categories') ->getChild('Shared Hosting') ->setIcon('fa-server fa-fw'); $SecondarySidebar->getChild('Categories') ->getChild('Game Servers') ->setIcon('fa-gamepad fa-fw'); $SecondarySidebar->getChild('Categories') ->getChild('Addons') ->setIcon('fa-plus-circle fa-fw'); } }); btw - if the sidebars look slightly different, this is because i'm doing this in a v7.2 dev... so this is what v7.2 is going to look like later this month. sometimes you won't need the fa-fw part (which is just to give them a fixed width). so in summary you can just use setIcon to assign a fontawesome/glyphicon to a child... same principle works for the navbar too. NOTE: updated for v7.6 in the thread below.. 0 Quote Link to comment Share on other sites More sharing options...
graisbeck Posted May 11, 2017 Author Share Posted May 11, 2017 Excellent! thanks again for all your help, brian! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.