I have created left sidebar using header. Inside links I have added sublinks. I have kept HEADER ORIENTATION as vertical.
Now default Link are closed. but whenever I refresh or open the page I want links to be open and I should be able to see the sublink.
So is there any way to do this ?
Regards,
Viraj Hapaliya
Hey @virajhapaliya If you want to keep the sublinks open, please feel free to try this code.
window.addEventListener('block-loaded-BLOCKID', () => {
document.querySelectorAll('.MuiAccordion-root').forEach((link) => {link.querySelector('div[role=button]').click()});
});
</script>
Just replace the BLOCKID in the code to your actual block name from the right side panel.
Okay Understood. but where Do I paste this code ?
Settings–>Custom code–>header section
Okay got it. It working now. Thanks