kwood Posted March 26, 2021 Share Posted March 26, 2021 Hi, Wonder if anyone could advise please. I am trying to either remove or alter the link of the 'portal home' but I cannot find it in the tpl. Not sure where else to look. I honestly just want to change were it points too. I have attached a copy of the HTML inspection of it, but I just cannot find it in any of the tpl files. If anyone could point me in the right direction, it would really be grateful. I am all new to php, and I am trying to teach myself as I go along. 0 Quote Link to comment Share on other sites More sharing options...
kwood Posted April 28, 2021 Author Share Posted April 28, 2021 I am not sure if this as been approved for access. I just wanted to bump it up, so people could see and hopefully help. Many thanks 0 Quote Link to comment Share on other sites More sharing options...
MrGettingRatherFrustrated Posted April 29, 2021 Share Posted April 29, 2021 You will find it in header.tpl <div class="navbar navbar-light"> <div class="container"> <a class="navbar-brand mr-3" href="{$WEB_ROOT}/index.php"> {if $assetLogoPath} <img src="{$assetLogoPath}" alt="{$companyname}" class="logo-img"> {else} {$companyname} {/if} </a> 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 29, 2021 Share Posted April 29, 2021 47 minutes ago, MrGettingRatherFrustrated said: You will find it in header.tpl technically, that piece of code posted is from /templates/(six or 21)/includes/breadcrumb.tpl rather than header.tpl. On 26/03/2021 at 09:56, kwood said: If anyone could point me in the right direction, it would really be grateful. I am all new to php, and I am trying to teach myself as I go along. probably the easiest way to change the link would be with PHP by using an action hook. <?php add_hook('ClientAreaPage', 1, function($vars) { $breadcrumb = $vars['breadcrumb']; $breadcrumb[0]['link'] = "https://www.google.co.uk"; return array('breadcrumb' => $breadcrumb); }); obviously, you won't want to link to Google, so that URL can be changed to either a full URL as above, or a local page, e.g clientarea.php 0 Quote Link to comment Share on other sites More sharing options...
kwood Posted May 12, 2021 Author Share Posted May 12, 2021 Great, thanks guys, I will have a look and ago, and I will let you know how I get on 0 Quote Link to comment Share on other sites More sharing options...
kwood Posted June 18, 2021 Author Share Posted June 18, 2021 On 29/04/2021 at 1:45 PM, brian! said: technically, that piece of code posted is from /templates/(six or 21)/includes/breadcrumb.tpl rather than header.tpl. probably the easiest way to change the link would be with PHP by using an action hook. <?php add_hook('ClientAreaPage', 1, function($vars) { $breadcrumb = $vars['breadcrumb']; $breadcrumb[0]['link'] = "https://www.google.co.uk"; return array('breadcrumb' => $breadcrumb); }); obviously, you won't want to link to Google, so that URL can be changed to either a full URL as above, or a local page, e.g clientarea.php Thank you very much, this has worked nicely. Would you mind breaking down each section of this code to explain how it works, please? I am trying to understand how this is able to do what it has done. I am considering on going onto a PHP course. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 18, 2021 Share Posted June 18, 2021 7 minutes ago, kwood said: Would you mind breaking down each section of this code to explain how it works, please? I am trying to understand how this is able to do what it has done. the add_hook line tells WHMCS which hook point to use - ClientAreaPage runs on all client area pages. $breadcrumb line takes the $breadcrumb array from the template. third line changes the 'link' value on the first element of the array fourth line returns the modified array back to the template for it to use. 8 minutes ago, kwood said: I am considering on going onto a PHP course. I can think of one or two members of WHMCS staff that you could take with you! 0 Quote Link to comment Share on other sites More sharing options...
kwood Posted June 18, 2021 Author Share Posted June 18, 2021 Thank you. It just helps me as I am learning. Hopefully I can get to the point where I can then help others. Not sure on the WHMCS staff though!! 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.