How to change the url of logo click

Hi,

Can you try this one (to be inserted in the header custom code)

<script>
window.addEventListener('block-loaded-revenue-base-header2', () => {
	const detail = { link: 'https://ttp360.softr.app' };
	window.dispatchEvent(new CustomEvent('set-logo-link-revenue-base-header2', { detail }));
});

window.addEventListener('block-loaded-revenue-base-header3', () => {
	const detail = { link: 'https://ttp360.softr.app/trips' };
	window.dispatchEvent(new CustomEvent('set-logo-link-revenue-base-header3', { detail }));
});
</script>

This is an old code I haven’t touched for long. It might not work. I will do some tests later if not working.

Hi Ben,

Yes

To be inserted in the header custom code of the page (or at app level)
Replace #home_header1 by your header blockID

<style>
#home_header1 .navbar-brand {
    pointer-events: none;
}
</style>

Thanks, i will try

It seems its working, thank you

Perfect!

Thank you Matthieu. But when I plug it into the custom code header section on the page where I want the logo to do nothing and change the label to the particular header, it still sends me home.

Can you show me your code? (all codes inside the header custom code)

Sure:

<style>
#home_header2 .navbar-brand {
    pointer-events: none;
}
</style>
<script> window.addEventListener('block-loaded-user-accounts1', () => { console.log("worked"); document.querySelectorAll('#user-accounts1 form')[1].children[1].style.display = 'none' }); 
</script>

It works fine on my end… I don’t know what’s wrong.

Try this one (with the !important):

<style>
#home_header2 .navbar-brand {
    pointer-events: none !important;
}
</style>

If not working try this one

<script>
window.addEventListener('block-loaded-home_header2', () => {
    document.querySelector('#home_header2 .navbar-brand').addEventListener('click', function(event) {
        event.preventDefault();
    });
});
</script>

Thanks for trying Matthieu. I plugged both of them in a couple of times, just over the existing script, but the logo still sends me to the home page. Appreciate the effort.

@Ben can you share your app’s link so we can try it online ?

@artur, this app’s still in production. Does the code work for you?

@Ben If I could see your app I can then try on it directly from browser itself…

Okay @artur. I DMd you a link.

As requested, I DMd a link about a week ago @artur but haven’t heard back from you.

Hi @Ben, I was off in between. Apologies for the delay.

Here is a code you can try

<script>
    window.addEventListener('block-loaded-home-header1', () => {
        const detail = { link: 'javascript:void(0);' };
    	window.dispatchEvent(new CustomEvent('set-logo-link-home-header1', { detail }));
    });
</script>

change home-header1 with your block identifier.

@matthieu_chateau FYI

Also working on my side!

I was off as well, or would have checked back earlier :wink:.
This one seems to work! At least in preview.

I think I have an on-boarding flow, using the User Profile block, with less friction now.
Thanks @artur!

I’m struggling with this as well.

I have 3 users: student, editorial, central.
Names of header with sublinks and button: home-student, home-editorial, home-central.
Code that I put for the entire website: settings (on left side with other options including users, theme, pages) → Custom code → header:

//students
window.addEventListener(ā€˜block-loaded-home-student’, () => {
const detail = { link: 'https://rrid-reviewer-selection.preview.softr.app/?show-toolbar=true
’ };
window.dispatchEvent(new CustomEvent(ā€˜set-logo-link-home-student’, { detail }));
});

//editorial
window.addEventListener(ā€˜block-loaded-home-editorial’, () => {
const detail = { link: ā€˜https://rrid-reviewer-selection.preview.softr.app/home-staff?autoUser=true&show-toolbar=true’ };
window.dispatchEvent(new CustomEvent(ā€˜set-logo-link-home-editorial’, { detail }));
});
//central
window.addEventListener(ā€˜block-loaded-home-central’, () => {
const detail = { link: ā€˜https://rrid-reviewer-selection.preview.softr.app/home-staff?autoUser=true&show-toolbar=true’ };
window.dispatchEvent(new CustomEvent(ā€˜set-logo-link-home-central’, { detail }));
});

What am I doing wrong?

@reily as you can see from this pic you have a formatting issue in your code

I corrected it here

<script>
//students
window.addEventListener('block-loaded-home-student', () => {
	const detail = { link: 'https://rrid-reviewer-selection.preview.softr.app/' };
	window.dispatchEvent(new CustomEvent('set-logo-link-home-student', { detail }));
});

//editorial
window.addEventListener('block-loaded-home-editorial', () => {
	const detail = { link: 'https://rrid-reviewer-selection.preview.softr.app/home-staff' };
	window.dispatchEvent(new CustomEvent('set-logo-link-home-editorial', { detail }));
});
//central
window.addEventListener('block-loaded-home-central', () => {
	const detail = { link: 'https://rrid-reviewer-selection.preview.softr.app/home-staff' };
	window.dispatchEvent(new CustomEvent('set-logo-link-home-central', { detail }));
});
</script>

Also remember to replace with non preview link later