ocastaned Posted May 20, 2017 Share Posted May 20, 2017 I am trying to change the URL for menu "Home" and my Logo to redirect them to my website homepage. I just updated to WHMCS 7.2.1. I hope you can help me guys. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 20, 2017 Share Posted May 20, 2017 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://forum.whmcs.com/showthread.php?126234-How-do-you-change-the-breadcrumbs-or-sidebar-code&p=505822#post505822 1 Quote Link to comment Share on other sites More sharing options...
ocastaned Posted May 20, 2017 Author Share Posted May 20, 2017 Thank you, for the Home menu worked fine, but for the Logo, I don't know where to add the URL I want to redirect to. {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} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 20, 2017 Share Posted May 20, 2017 just replace the "{$web_root}/index.php" part - either with a full site URL or maybe "../index.,php" 0 Quote Link to comment Share on other sites More sharing options...
ocastaned Posted May 20, 2017 Author Share Posted May 20, 2017 Thank you so much. It worked fine. 0 Quote Link to comment Share on other sites More sharing options...
Thomasmcdaniel9 Posted November 27, 2019 Share Posted November 27, 2019 Hey guys I hope this is still active. Im not very good at this because it did not work for me I use cpanel file manager located the whmcs file added code to the template index file nothing changed. Please help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 28, 2019 Share Posted November 28, 2019 On 27/11/2019 at 03:05, Thomasmcdaniel9 said: Hey guys I hope this is still active. Im not very good at this because it did not work for me I use cpanel file manager located the whmcs file added code to the template index file nothing changed. Please help this old solution was to change the link used by your logo on the WHMCS page - from reading your other thread, I think your situation relates to changing the link on the home menu button, which would require a different solution. 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 12, 2020 Share Posted November 12, 2020 @brian! Is there any way to change the Logo URL by WHMCS hook? Not ''Home" URL, I want to change Logo URL. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 12, 2020 Share Posted November 12, 2020 24 minutes ago, Md Rasel Khan said: @brian! Is there any way to change the Logo URL by WHMCS hook? Not ''Home" URL, I want to change Logo URL. you want to change the logo to use a remote URL image, or you want to change the URL that the logo links to ?? 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 12, 2020 Share Posted November 12, 2020 10 minutes ago, brian! said: you want to change the logo to use a remote URL image, or you want to change the URL that the logo links to ?? Sorry for the less information. I want to change the URL that the logo links to. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 12, 2020 Share Posted November 12, 2020 <?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...
Md Rasel Khan Posted November 12, 2020 Share Posted November 12, 2020 8 minutes ago, 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"); Thanks a lot! How to open the link in new tab? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 12, 2020 Share Posted November 12, 2020 10 minutes ago, Md Rasel Khan said: Thanks a lot! How to open the link in new tab? change the href line of code to... $('a.logo').attr({href:'https://www.google.com',target:'_blank'}); 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 12, 2020 Share Posted November 12, 2020 Thanks! How can I open this link in new tab? 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 12, 2020 Share Posted November 12, 2020 1 hour ago, Md Rasel Khan said: Thanks! How can I open this link in new tab? @brian! setUri link should be open in new tab. Please help me, thanks! siderbar.php 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted November 13, 2020 Share Posted November 13, 2020 Hi, How can I add a logo here while clients login to client Area ? Thanks... 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted November 13, 2020 Share Posted November 13, 2020 6 minutes ago, VirtualWorldGlobal said: Hi, How can I add a logo here while clients login to client Area ? Thanks... You will need to edit the template (.tpl) files and just add the logo as any other regular HTML. Or you can add with it CSS as well. 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted November 13, 2020 Share Posted November 13, 2020 Thanks . That option would not be convenient for me as I don't have any knowledge of coding, can a hook perform this action ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 13, 2020 Share Posted November 13, 2020 21 hours ago, Md Rasel Khan said: setUri link should be open in new tab. Please help me, thanks! setURI just specified the URL to use, if you want more, you would need to use setAttribute.... your quoted code is about navbars, but the attachment is sidebars - i'll choose one as an example, but it's the same code for either... // Sidebar->Support->Blog/News if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->getChild('Announcements') ->setLabel("Blog/News") ->setUri('https://omnisoftit.com/blog') ->setAttribute('target','_blank') ->setOrder(0); } 4 hours ago, VirtualWorldGlobal said: can a hook perform this action ? <?php # Show Logo On Login Page Hook # Written by brian! function show_logo_on_login_page_hook($vars) { if ($vars['showingLoginPage']) { $imageurl = 'https://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg'; $output .= '<script type="text/javascript"> $(document).ready(function(){ $("<img src=\"'.$imageurl.'\" >").insertBefore(".header-lined"); }); </script>'; return $output; } } add_hook("ClientAreaHeaderOutput", 1, "show_logo_on_login_page_hook"); if the image isn't the correct size, then you will have set its dimension in the code - either as a CSS class which you had to the img tag, or specific width/height dimensions. 1 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 14, 2020 Share Posted November 14, 2020 11 hours ago, brian! said: setURI just specified the URL to use, if you want more, you would need to use setAttribute.... your quoted code is about navbars, but the attachment is sidebars - i'll choose one as an example, but it's the same code for either... // Sidebar->Support->Blog/News if (!is_null($secondarySidebar->getChild('Support'))) { $secondarySidebar->getChild('Support') ->getChild('Announcements') ->setLabel("Blog/News") ->setUri('https://omnisoftit.com/blog') ->setAttribute('target','_blank') ->setOrder(0); } Thanks! Is there any way to add this line on the head.tpl file by hook? Not by directly editing the head.tpl file. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 14, 2020 Share Posted November 14, 2020 7 hours ago, Md Rasel Khan said: Is there any way to add this line on the head.tpl file by hook? Not by directly editing the head.tpl file. 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 14, 2020 Share Posted November 14, 2020 On 6/6/2020 at 5:45 PM, brian! said: ideally, you wouldn't edit any template for this - it's really a task for a hook (otherwise you'll be editing the template after every update). <? add_hook('ClientAreaHeadOutput', 1, function($vars) { return '<link rel="icon" href="https://www.youstable.com/favicon.ico" />'; }); @brian! Thanks a lot! Is there any way to add this custom CSS by hook? 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 14, 2020 Share Posted November 14, 2020 1@brian! And how can I replace the marked (1) text with the marked (2) text by hook? Default code of HTML: <small>This page is restricted</small> Maybe custom code of HTML: <small><i class="fa fa-lock"></i> Secured by 2048-bit SSL encryption</small> 0 Quote Link to comment Share on other sites More sharing options...
Md Rasel Khan Posted November 14, 2020 Share Posted November 14, 2020 38 minutes ago, Md Rasel Khan said: @brian! Thanks a lot! Is there any way to add this custom CSS by hook? @brian! I have added the custom CSS using your way. 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? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
ManagedCloud-Hosting Posted November 14, 2020 Share Posted November 14, 2020 Thanks @brian! On 11/13/2020 at 9:36 PM, brian! said: <?php # Show Logo On Login Page Hook # Written by brian! function show_logo_on_login_page_hook($vars) { if ($vars['showingLoginPage']) { $imageurl = 'https://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg'; $output .= '<script type="text/javascript"> $(document).ready(function(){ $("<img src=\"'.$imageurl.'\" >").insertBefore(".header-lined"); }); </script>'; return $output; } } add_hook("ClientAreaHeaderOutput", 1, "show_logo_on_login_page_hook"); 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.