Jump to content

$assetLogoPath


Chris Morley

Recommended Posts

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.

Link to comment
Share on other sites

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. :idea:

Link to comment
Share on other sites

  • WHMCS Technical Analyst
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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 6 years later...
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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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! 🥳

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated