Jump to content

Changing Logo URL in Header on Twenty-One


Mandalorian

Recommended Posts

23 minutes ago, AALayer said:

Are you modifying /header.tpl  right? Make sure you have cleared your caches [server/locally] and try again.

Thanks for replying.

This is the code I modified in header.tpl.

            <div class="container">
                <a class="navbar-brand mr-3" href="{$WEB_ROOT}/index.php">
                    {if $assetLogoPath}
                        <img src="{$assetLogoPath}" alt="{$companyname}" class="logo-img">
                    {else}
                        {$companyname}
                    {/if}
                </a>

I changed "{$WEB_ROOT}/index.php to my own URL.

Cleared the cache too, but no luck.

Any ideas?

Link to comment
Share on other sites

9 hours ago, Damo said:

Instead of modifying the template you should create a child template. That way your changes won't get overwritten when an update comes out for Twenty One. 
 

 

That's good advice, @Damo Thank you 🙂

For now I had to revert to SIX.

Will use a child template as per the link you shared, as soon Twenty-One template's design issues are fixed by whmcs.

Waiting for a 8.1 maintenance release with bug fixes.

Be well!

Link to comment
Share on other sites

16 hours ago, Mandalorian said:

Any idea how to change the URL of the Header Logo please?

you can use a hook to modify the URL.

the above would only work for Six and related themes, not 21 - though 21 hadn't even been released in beta when I wrote that hook code. 🤪

if you want to tweak it for 21 (or a child of 21)...

<?php

# Change Logo URL in Twenty-One Hook
# Written by brian!

function change_logo_url_hook($vars) {
	
	return "<script>
$(function(){
   $('a.navbar-brand').attr({href:'https://www.google.com',target:'_blank'});
});
</script>";
}
add_hook("ClientAreaFooterOutput", 1, "change_logo_url_hook");

.. and for the 1,545th time, can I complain about WHMCS not adding proper unique IDs to their elements - it would make like so much easier if they did.

Link to comment
Share on other sites

3 hours ago, brian! said:

you can use a hook to modify the URL.

the above would only work for Six and related themes, not 21 - though 21 hadn't even been released in beta when I wrote that hook code. 🤪

if you want to tweak it for 21 (or a child of 21)...


<?php

# Change Logo URL in Twenty-One Hook
# Written by brian!

function change_logo_url_hook($vars) {
	
	return "<script>
$(function(){
   $('a.navbar-brand').attr({href:'https://www.google.com',target:'_blank'});
});
</script>";
}
add_hook("ClientAreaFooterOutput", 1, "change_logo_url_hook");

.. and for the 1,545th time, can I complain about WHMCS not adding proper unique IDs to their elements - it would make like so much easier if they did.

Ah cheers, Brian!

The knight in the shining armor 🙂

Need your advice.  Please see my PM.

Edited by Mandalorian
Link to comment
Share on other sites

23 hours ago, Mandalorian said:

@brian! You seem to have disabled the direct messages 😔

not disabled - just a full mailbox... the price I willingly pay for resigning from the pointless GearHead rank many years ago when I got sick of the pathetic intimidation a certain staff member tried to impose...  😎

try sending again.

Link to comment
Share on other sites

19 minutes ago, brian! said:

not disabled - just a full mailbox... the price I willingly pay for resigning from the pointless GearHead rank many years ago when I got sick of the pathetic intimidation a certain staff member tried to impose...  😎

try sending again.

Cheers, Brian!!!

The thing is people trust you and your judgment on all things whmcs.

Just inboxed you 😊

Be well,

 

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