Jump to content
Marco Aguilar

Client Area Logo - Retina Compatible

Recommended Posts

Hi! I just created a brand new WHMCS installation, but now I'm trying to show a retina compatible logo at client area. I am uploading at /assents/img/logo.png and /assents/img/logo@2x.png however logo@2x.png file is ignored.

Even I try to create a hook defining a new $assetLogoPath with a .svg file but doesn't work either.

Can you have any idea to add Retina Compatibility to client area logo?

Share this post


Link to post
Share on other sites
3 hours ago, brian! said:

 

Hi @brian! I tried this before, however, it doesn't work. I am not sure I am doing it right. I create a new hook changing the svg filename at /includes/hooks/newhook.php and put the image.svg at /assets/img/ but nothing happends. There is something I made wrong?

Share this post


Link to post
Share on other sites

I think you're doing it right, but sometimes the problem is the .svg file itself... i've seen it fail with some .svg files, but work with most others... 9_9

for example, in the above linked hook thread, the .svg used is from wikimedia... https://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg ... and that works. :idea:

iyP9L9t.png

similarly, if I download a logo from a GitHub repository, then they seem to work too...

6VWC85q.png1i6Ch5Y.png

so try the hook using one of those logos, and that should tell you whether the hook will work for you, or if there is an issue with your svg logo itself... also, I assume you have checked that the template (if custom) is actually using $assetLogoPath ?

Share this post


Link to post
Share on other sites
On 24/5/2018 at 3:23 AM, brian! said:

I think you're doing it right, but sometimes the problem is the .svg file itself... i've seen it fail with some .svg files, but work with most others... 9_9

for example, in the above linked hook thread, the .svg used is from wikimedia... https://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg ... and that works. :idea:

iyP9L9t.png

similarly, if I download a logo from a GitHub repository, then they seem to work too...

6VWC85q.png1i6Ch5Y.png

so try the hook using one of those logos, and that should tell you whether the hook will work for you, or if there is an issue with your svg logo itself... also, I assume you have checked that the template (if custom) is actually using $assetLogoPath ?

I again @brian! probably there is something wrong because even with those images still broken. Just text appears. :( You have another idea?

Share this post


Link to post
Share on other sites
11 hours ago, Marco Aguilar said:

I again @brian! probably there is something wrong because even with those images still broken. Just text appears. :( You have another idea?

if it's just showing text, that would imply that it's either not finding the image in the path supplied, or perhaps a corrupt file / wrong mime type...

here's a test, try the hook below and see if it works (does for me) - it's loading the image from a remote Wikimedia server, so it's bypassing any local paths previously defined...

<?php

# Define $assetLogoPath 
# Written by brian!

function custom_base_img_path_hook($vars) 
{
   return array("assetLogoPath" => "https://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg");
}
add_hook("ClientAreaPage", 1, "custom_base_img_path_hook");
?>

with a bit of effort, you can even remotely link to the GitHub logos (not that you should in practice - we're just testing!)..

7sY02CQ.png

you won't need to do that though - either the above remote Wikimedia SVG logo will work for you... or it won't. :)

if it doesn't work, then can you view the local .svg logo in the browser directly, e.g by typing the direct path of the image in the browser address bar?

if you're still having issues, then feel free to send me a PM with a link to your WHMCS site... maybe once I see the site, I can see the cause of the problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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