How to change the url of logo click

Below is a code snippet that allows to change the url of logo in the webapp/website. Simply replace the google url with your desired url.

<script>
    document.addEventListener("DOMContentLoaded", function () {   
        $('a.navbar-brand').attr('href', 'https://google.com');
    });
</script>
2 Likes

Is there a way for this to be done with specific user visible blocks? Ex. One version of the header would link to a particular site/page when clicking the logo, while another header would link to a different site/page.

1 Like

Iā€™d appreciate this as well!

@Justin_JMP @rebeccajane

here is an example:

<script>
    document.addEventListener("DOMContentLoaded", function () {   
        $('#header-block-name1 a.navbar-brand').attr('href', 'https://google.com');
        $('#header-block-name2 a.navbar-brand').attr('href', 'https://yahoo.com');
    });
</script>

header-block-name1 and header-block-name2 are the block names you see in the studio block settings panel

1 Like

Thanks for looking into this @artur! Can confirm it works exactly as intended :slight_smile:! Appreciate the help.

3 Likes