Marco Aguilar Posted May 22, 2018 Share Posted May 22, 2018 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 23, 2018 Share Posted May 23, 2018 0 Quote Link to comment Share on other sites More sharing options...
Marco Aguilar Posted May 23, 2018 Author Share Posted May 23, 2018 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2018 Share Posted May 24, 2018 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... 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. similarly, if I download a logo from a GitHub repository, then they seem to work too... 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 ? 0 Quote Link to comment Share on other sites More sharing options...
Marco Aguilar Posted May 28, 2018 Author Share Posted May 28, 2018 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... 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. similarly, if I download a logo from a GitHub repository, then they seem to work too... 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 29, 2018 Share Posted May 29, 2018 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!).. 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. 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.