Davor Posted August 31, 2021 Share Posted August 31, 2021 Hello, I have a hook that redirects the Home navigation from Portal home to my Homepage: use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Home'))) { $primaryNavbar->getChild('Home') ->setURI('../'); } }); But can't find a hook to change when a user clicks on the Icon in the Header to also change it to homepage and not to the Portal home. Been looking for hours now, but no luck. 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 31, 2021 Share Posted August 31, 2021 Why not change it from the header.tpl? 0 Quote Link to comment Share on other sites More sharing options...
Davor Posted August 31, 2021 Author Share Posted August 31, 2021 (edited) Will this not be replaced every time new version is installed? If not, could you tell me how? Thanks, Davor Edited August 31, 2021 by Davor spelling 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 31, 2021 Share Posted August 31, 2021 That’s why you create a custom template folder, but you will have to update again… 0 Quote Link to comment Share on other sites More sharing options...
Davor Posted September 1, 2021 Author Share Posted September 1, 2021 Thank pRieStaKos, would be the header.tpl the only way or does anyone maybe have an idea on how to do it with hooks? 0 Quote Link to comment Share on other sites More sharing options...
Davor Posted September 2, 2021 Author Share Posted September 2, 2021 I got it. If anyone else needs this, here is the solution. But you need to take into consideration that every WHMCS System Theme (General Settings > General > System Theme) is obviously having a different class for the logo image. Here is the hook code: #works, but each WHMCS System Theme is having different class for the logo image # WHMCS System Theme Six is a.logo # WHMCS System Theme Twenty-One is a.navbar-brand function change_logo_url_hook($vars) { return "<script> $(function(){ $('a.logo').attr('href','https://www.MyHomepage.com'); $('a.navbar-brand').attr('href','https://www.MyHomepage.com'); }); </script>"; } add_hook("ClientAreaHeadOutput", 1, "change_logo_url_hook"); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 3, 2021 Share Posted October 3, 2021 On 31/08/2021 at 21:34, Davor said: Been looking for hours now, but no luck. it's out there! that's where you copied *my* code from - it's not difficult to link to the original thread, rather than imply that you wrote it yourself! 🙄 On 02/09/2021 at 20:07, Davor said: But you need to take into consideration that every WHMCS System Theme (General Settings > General > System Theme) is obviously having a different class for the logo image. then you get the hook to find the current theme name and react accordingly.... as I mention in the above thread! 🙄 1 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.