Chris Morley Posted May 17, 2017 Share Posted May 17, 2017 There's some new code in the six theme header.tpl in WHMCS 7.2: {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} Can anyone advise where $assetLogoPath is defined? I can't seem to find a way to set this / upload a logo in WHMCS admin. Specifying the logo option in WHMCS admin does not seem to change this, it only affects the logo used in email messages. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 17, 2017 Share Posted May 17, 2017 Hi Chris, There's some new code in the six theme header.tpl in WHMCS 7.2:Can anyone advise where $assetLogoPath is defined? I can't seem to find a way to set this / upload a logo in WHMCS admin. Specifying the logo option in WHMCS admin does not seem to change this, it only affects the logo used in email messages. I don't think it is defined and could see no mention of it in the documentation... however, logically you could define it using an action hook... <?php # Define $assetLogoPath # Written by brian! function custom_base_img_path_hook($vars) { return array("assetLogoPath" => $vars['BASE_PATH_IMG']."/whmcs.png"); } add_hook("ClientAreaPage", 1, "custom_base_img_path_hook"); ?> then it should just be a case of tweaking the path to the correct logo in the hook. 0 Quote Link to comment Share on other sites More sharing options...
Lufi Posted May 17, 2017 Share Posted May 17, 2017 Of course it is describe in the documentation. http://docs.whmcs.com/Version_6.0_Release_Notes#New_Location_for_Custom_Logo_Files If you have once of these files: /assets/img/logo.png /assets/img/logo.jpg $assetLogoPath is set. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 18, 2017 Share Posted May 18, 2017 Of course it is describe in the documentation.http://docs.whmcs.com/Version_6.0_Release_Notes#New_Location_for_Custom_Logo_Files good spot - but the hook is still valid if you want to use a different directory. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Technical Analyst WHMCS Edward Posted May 18, 2017 WHMCS Technical Analyst Share Posted May 18, 2017 Of course it is describe in the documentation.http://docs.whmcs.com/Version_6.0_Release_Notes#New_Location_for_Custom_Logo_Files If you have once of these files: /assets/img/logo.png /assets/img/logo.jpg $assetLogoPath is set. That's exactly right. The $assetLogoPath will be set with the path to one of those two logo image files, whichever exists. If neither does, it won't be set, and your company name will be displayed instead. -Ed 0 Quote Link to comment Share on other sites More sharing options...
Snowman Posted May 24, 2017 Share Posted May 24, 2017 That's exactly right. The $assetLogoPath will be set with the path to one of those two logo image files, whichever exists. If neither does, it won't be set, and your company name will be displayed instead. -Ed Had me puzzled for a while... thanks for the info on this as i previously couldn't find anything about it seems a bit counterproductive this setting that has been added for this because if your using a custom template, which is recommended then i would have thought it should be looking by default for the image in the images folder of that template, not in the assets folder... or it should use the one defined in the admin settings function? 0 Quote Link to comment Share on other sites More sharing options...
MikeP Posted February 18 Share Posted February 18 This doesn't seem to be working in 8.8.0 - any suggestions? 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 18 Share Posted February 18 What do you mean it's not working? $assetLogoPath still works 😄 You will have to have a file called /assets/img/logo.png or /assets/img/logo.jpg before the variable has a value. 0 Quote Link to comment Share on other sites More sharing options...
MikeP Posted February 18 Share Posted February 18 22 minutes ago, DennisHermannsen said: What do you mean it's not working? $assetLogoPath still works 😄 You will have to have a file called /assets/img/logo.png or /assets/img/logo.jpg before the variable has a value. Sorry, I was referring to the hook. I came from another post - this was the original. 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 19 Share Posted February 19 I just tested the hook and it works fine here. Are you sure you installed the hook correctly? 0 Quote Link to comment Share on other sites More sharing options...
MikeP Posted February 19 Share Posted February 19 9 hours ago, DennisHermannsen said: I just tested the hook and it works fine here. Are you sure you installed the hook correctly? I put the code into a php file and uploaded it to the hooks directory, tried putting the logo file in /assets/img/logo.svg and in the hooks folder but nothing worked, should I be doing something else? 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 20 Share Posted February 20 If you didn't modify the hook, the logo needs to be called /assets/img/whmcs.png. 0 Quote Link to comment Share on other sites More sharing options...
MikeP Posted February 20 Share Posted February 20 1 hour ago, DennisHermannsen said: If you didn't modify the hook, the logo needs to be called /assets/img/whmcs.png. I changed it to logo.svg and uploaded the logo.svg file in the root, hooks and /assets/imgs/ folder, it didn't work for me. Not sure if I removed the other logo files when testing. Managed to get a HQ PNG sorted out so the crisis is averted! 🥳 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted February 20 Share Posted February 20 20 minutes ago, MikeP said: I changed it to logo.svg and uploaded the logo.svg file in the root, hooks and /assets/imgs/ folder, it didn't work for me. That's because you're uploading it to the wrong directory. The hook goes inside /includes/hooks/. The logo.svg needs to be in /assets/img/. All paths are relative to the WHMCS root directory. 0 Quote Link to comment Share on other sites More sharing options...
MikeP Posted February 20 Share Posted February 20 1 minute ago, DennisHermannsen said: That's because you're uploading it to the wrong directory. The hook goes inside /includes/hooks/. The logo.svg needs to be in /assets/img/. All paths are relative to the WHMCS root directory. Oh.... /includes/hooks - I've been putting them in /hooks 🤦♂️ Thanks! 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.