Is there a way to hide the (shared) mega menu on a specific custom page?
Hey
<script>
document.addEventListener('DOMContentLoaded', function () {
if (window.location.href === 'https://yourcommunity.com/p/yourcustompage') { // Replace with the link to your custom page
;
const interval = setInterval(function () {
const navSection = document.querySelector('.main-navigation-sitewidth');
if (navSection) {
navSection.remove();
clearInterval(interval);
}
}, 100);
}
});
</script>
Thanks
<script>
document.addEventListener('DOMContentLoaded', function () {
if (window.location.href === 'https://yourcommunity.com/p/yourcustompage') { // Replace with the link to your custom page
;
const interval = setInterval(function () {
const navSection = document.querySelector('.main-navigation--wrapper.header-navigation');
if (navSection) {
navSection.remove();
clearInterval(interval);
}
}, 100);
}
});
</script>
And here’s an extension to include multiple pages and partial urls:
<script>
document.addEventListener('DOMContentLoaded', function () {
// Array of URL fragments to check
const targetUrls = =
'/p/yourcustompage', // Partial path or substring to match
'/p/anotherpage', // Add more as needed
'/p/andanotherone' // Example of another partial URL
];
// Check if the current URL contains any of the target strings
const currentUrl = window.location.href;
const isTargetPage = targetUrls.some(urlFragment => currentUrl.includes(urlFragment));
if (isTargetPage) {
const interval = setInterval(function () {
const navWrapper = document.querySelector('.main-navigation--wrapper.header-navigation');
if (navWrapper) {
navWrapper.remove(); // Remove the element
clearInterval(interval); // Stop checking
}
}, 100);
}
});
</script>
Awesome
Reply
Sign up
If you ever had a profile with us, there's no need to create another one.
Don't worry if your email address has since changed, or you can't remember your login, just let us know at community@gainsight.com and we'll help you get started from where you left.
Else, please continue with the registration below.
Welcome to the Gainsight Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.