brian! Posted November 15, 2020 Share Posted November 15, 2020 20 hours ago, Md Rasel Khan said: Is there any way to add this custom CSS by hook? there is a custom.css file in your active theme /css folder - that's where WHMCS would expect you to add custom CSS... just remember that if you're using Six (and I can you are), keep a copy of the custom.css file as WHMCS will overwrite it during an update. 19 hours ago, Md Rasel Khan said: And how can I replace the marked (1) text with the marked (2) text by hook? no hook needed for this - use Language Overrides to change existing strings - don't edit the original language files... $_LANG['restrictedpage'] = "This page is restricted"; 19 hours ago, Md Rasel Khan said: I have added the custom CSS using your way. I didn't suggest adding CSS to the client area via a hook! it's an option in the admin area as you don't where there are no custom css options, but in the client area, you already have an existing custom.css file that you can use for your CSS changes... again, just remember to keep a backup. 19 hours ago, Md Rasel Khan said: Do you think it is a good practice? Or do you have better way? And in the future If I update the WHMCS this mystyle.css will be removed or not? the only real reason to add mystyle.css via a hook is that it will NOT get deleted by the updater... personally, I wouldn't store a .css file in the hooks folder, I would move it to the /css folder within your active (*Six") /css folder.... having the css in the hooks folder would work - it just feels wrong and you'll be using files stored in various locations and so could make updating more difficult and confusing. 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 17, 2020 Share Posted November 17, 2020 On 11/15/2020 at 7:58 PM, brian! said: no hook needed for this - use Language Overrides to change existing strings - don't edit the original language files... $_LANG['restrictedpage'] = "This page is restricted"; @brian! Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 17, 2020 Share Posted November 17, 2020 On 11/15/2020 at 7:58 PM, brian! said: the only real reason to add mystyle.css via a hook is that it will NOT get deleted by the updater... personally, I wouldn't store a .css file in the hooks folder, I would move it to the /css folder within your active (*Six") /css folder.... having the css in the hooks folder would work - it just feels wrong and you'll be using files stored in various locations and so could make updating more difficult and confusing. So what you think If I keep the mystyle.css file in the six/css folder instead of the hook folder? And after the update, will this file be removed? 0 Quote Link to comment Share on other sites More sharing options...
Pitago Posted November 19, 2020 Share Posted November 19, 2020 How to change the whmcs homepage logo link so that it can redirect to my website 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 20, 2020 Share Posted November 20, 2020 7 hours ago, Pitago said: How to change the whmcs homepage logo link so that it can redirect to my website On 11/12/2020 at 8:15 PM, brian! said: <?php # Change Logo URL Hook # Written by brian! function change_logo_url_hook($vars) { return "<script> $(function(){ $('a.logo').attr('href','https://www.google.com'); }); </script>"; } add_hook("ClientAreaFooterOutput", 1, "change_logo_url_hook"); Follow this... 1 Quote Link to comment Share on other sites More sharing options...
Marudhu Posted November 28, 2020 Share Posted November 28, 2020 On 20/05/2017 at 10:23 PM, brian! said: php fil On 20/05/2017 at 10:23 PM, brian! said: the logo link is in header.tpl... {if $assetLogoPath} <a href="{$WEB_ROOT}/index.php" class="logo"><img src="{$assetLogoPath}" alt="{$companyname}"></a> {else} <a href="{$WEB_ROOT}/index.php" class="logo logo-text">{$companyname}</a> {/if} and for the menu, add a .php file to /includes/hooks and add... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home') ->setURI('http://www.google.com'); } }); https://community.whmcs.com/showthread.php?126234-How-do-you-change-the-breadcrumbs-or-sidebar-code&p=505822#post505822 I need to change the redirection link of the home menu. while following your advice , I found that I don't have a hooks folder inside the include folder. Should I add a new folder named hooks ? and one more thing what should be the .php file name to be added? 0 Quote Link to comment Share on other sites More sharing options...
Marudhu Posted November 29, 2020 Share Posted November 29, 2020 On 20/05/2017 at 10:23 PM, brian! said: the logo link is in header.tpl... {if $assetLogoPath} <a href="{$WEB_ROOT}/index.php" class="logo"><img src="{$assetLogoPath}" alt="{$companyname}"></a> {else} <a href="{$WEB_ROOT}/index.php" class="logo logo-text">{$companyname}</a> {/if} and for the menu, add a .php file to /includes/hooks and add... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home') ->setURI('http://www.google.com'); } }); https://community.whmcs.com/showthread.php?126234-How-do-you-change-the-breadcrumbs-or-sidebar-code&p=505822#post505822 As mentioned for logo I changed the header.tpl file and it worked fine. But for Home menu link As mentioned I've no hooks folder in include folder. Should I add a new one and what should be name of the php file where that give code should be given ? Please advise.. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 1, 2020 Share Posted December 1, 2020 On 29/11/2020 at 03:34, Marudhu said: But for Home menu link As mentioned I've no hooks folder in include folder. it's not the /includes folder that's within the /templates/six folder etc, there is a folder in your WHMCS main folder called 'includes' and inside there will be a folder called 'hooks' - that's where these hooks should go. On 29/11/2020 at 03:34, Marudhu said: Should I add a new one and what should be name of the php file where that give code should be given ? Please advise.. the file can be called whatever you like - but no spaces and it must end .php 0 Quote Link to comment Share on other sites More sharing options...
Pasqual Posted December 25, 2021 Share Posted December 25, 2021 I use this hook to customize the logo url and it works perfectly, but I like to customize the logo link url according to the selected language. Any suggestions on how to do this? <?php # Change Logo URL Hook # Written by brian! function change_logo_url_hook($vars) { return "<script> $(function(){ $('a.logo').attr('href','https://www.google.com'); }); </script>"; } add_hook("ClientAreaFooterOutput", 1, "change_logo_url_hook"); 0 Quote Link to comment Share on other sites More sharing options...
anshujha Posted January 14, 2022 Share Posted January 14, 2022 <?php # Change Logo URL Hook # Written by brian! function change_logo_url_hook($vars) { return "<script> $(function(){ $('a.logo').attr('href','https://www.google.com'); }); </script>"; } add_hook("ClientAreaFooterOutput", 1, "change_logo_url_hook"); This script is only working on desktop devices, in mobile device url redirection not working 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.