hostxls Posted August 19, 2016 Share Posted August 19, 2016 Hello, I have seen that there isn't a link to return to the client dashboard when you are in the client area. Is it possible to make the 'Welcome, Name' redirect to the dashboard ( /clients/clientarea.php) and how do I do that. Thanks, 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 19, 2016 Share Posted August 19, 2016 normally, when the client is logged in and in their client area, they can click the "Home" button on the navbar to return to the client area homepage. however, I notice that when not logged in, your home button goes to your parent site... that likely means that the logged in home link won't work either. try going to setup -> general settings -> general -> WHMCS System URL (or WHMCS SSL System URL) - I suspect the current value in there is "https://www.hostxls.com/" - change it to "https://www.hostxls.com/clients/" and then see if the home button works correctly when logged in. 0 Quote Link to comment Share on other sites More sharing options...
hostxls Posted August 19, 2016 Author Share Posted August 19, 2016 try going to setup -> general settings -> general -> WHMCS System URL (or WHMCS SSL System URL) - I suspect the current value in there is "https://www.hostxls.com/" - change it to "https://www.hostxls.com/clients/" and then see if the home button works correctly when logged in. I'm sorry but it was always this link ( "https://www.hostxls.com/clients/") that we have used. see image. I it possible to ad a 'dashboard' link in the Account Tab and how can I do that? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 19, 2016 Share Posted August 19, 2016 (edited) I'm sorry but it was always this link ( "https://www.hostxls.com/clients/") that we have used. see image. so with the client logged in, where does the "Home" button link too... by default, it should be "https://www.hostxls.com/clients/clientarea.php"... actually, it's strange it doesn't point to https://www.hostxls.com/clients/index.php when not logged in you haven't modified the navbar in anyway have you - template, hook etc ? I it possible to ad a 'dashboard' link in the Account Tab and how can I do that? yes, using an action hook. http://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet Edited August 19, 2016 by brian! 0 Quote Link to comment Share on other sites More sharing options...
hostxls Posted August 19, 2016 Author Share Posted August 19, 2016 Wonderful Thanks again 0 Quote Link to comment Share on other sites More sharing options...
hostxls Posted August 20, 2016 Author Share Posted August 20, 2016 so with the client logged in, where does the "Home" button link too... by default, it should be "https://www.hostxls.com/clients/clientarea.php"... actually, it's strange it doesn't point to https://www.hostxls.com/clients/index.php when not logged in you haven't modified the navbar in anyway have you - template, hook etc ? Yep, I have change the point to address, because otherwise you can not go back to the normal website (http://www.hostxls.com) With the Home link you will stay on the client website. That's why I need to create the "dashboard" link within the client "Hello, xxx!" tab. So that the client always can go back to his/her dashboard and with the Home to the home website. 0 Quote Link to comment Share on other sites More sharing options...
hostxls Posted August 20, 2016 Author Share Posted August 20, 2016 Hello Brian, I have try to enter a new child into the Account tab ( Hello, Vincent!) as you can see in the image using this hook but it seems not to work. What am I doing wrong? Can you help fix this. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('Primary_Navbar-Account', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Account'))) { $primaryNavbar->getChild('Account') ->addChild('Dashboard', array( 'label' => 'Dashboard', 'uri' => 'https://hostxls.com/clients/clientarea.php', 'order' => '100', )); } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 20, 2016 Share Posted August 20, 2016 Yep, I have change the point to address, because otherwise you can not go back to the normal website (www.hostxls.com) With the Home link you will stay on the client website. yes, but there currently is no real site at hostxls.com, just a holding page. in any event, you're going to integrate your WHMCS site into Wordpress at some point, so when that occurs, both links will likely be there and it would make more sense for the "Home" link to either go to clients/index.php when logged out, or clients/clientarea.php when logged in - which it should do by default anyway. That's why I need to create the "dashboard" link within the client "Hello, xxx!" tab.So that the client always can go back to his/her dashboard and with the Home to the home website. if it were me, what I would do is leave the "Home" link working as it should (as above) and change the link on the hostxls logo to go back to the main site... that's just a minor tweak to header.tpl I have try to enter a new child into the Account tab ( Hello, Vincent!) as you can see in the image using this hook but it seems not to work.What am I doing wrong? Can you help fix this. that right hand navbar is a Secondary navbar, not Primary - so your were using the wrong action hook (and using it wrongly too!) <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->addChild('Dashboard', array( 'label' => 'Dashboard', 'uri' => 'clientarea.php', 'order' => '100', )); } }); personally, I don't think that's a good place to put it... as the client wouldn't know it was there unless they saw it... if you're going to do something like this, it almost makes more sense to change "Home" into a dropdown with two links - one to your "main site" and another to "dashboard". though I return to my earlier point that if/when your site is going to get integrated into WP, then you shouldn't really need to be messing with the navbars like this... but it's entirely up to you! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 20, 2016 Share Posted August 20, 2016 I should have made the navbar hook only work for logged in clients... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { $client = Menu::context('client'); if (!is_null($client) && !is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->addChild('Dashboard', array( 'label' => 'Dashboard', 'uri' => 'clientarea.php', 'order' => '100', )); } }); 0 Quote Link to comment Share on other sites More sharing options...
hostxls Posted August 20, 2016 Author Share Posted August 20, 2016 (edited) Yes, now only login users could enter the client area. Thanks for the code. I can see where I went wrong Edited August 20, 2016 by hostxls 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 20, 2016 Share Posted August 20, 2016 Yes, now only login users could enter the client area. it doesn't really matter as logged out clients would just be redirected to the login page... I just thought it looked cleaner / made sense to only show the link for logged in users. 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.