In this documentation we will show you step by step how to add a link in the Navbar of your store. For this we will share a code and we will indicate where to add it.
If you are using our new version of the menu, you will be able to add links directly by creating a URL type item. Here we share more information.
We will create the following link:
1. Go to Control Panel > Settings > Advanced and check the Custom before </body> code box
2. There you must paste the following code, modifying only what is in bold:
<!-- Insertar un link en el Navbar -->
<script>
var navbarLogin = document.querySelector('#navbarSupportedContent ul li:first-child');
var navbarGuest = document.querySelector('.navbar-nav .nav-item');
var navbar = navbarLogin ? navbarLogin : navbarGuest;
navbar.insertAdjacentHTML( 'beforebegin', '<li class="nav-item"><a href="https://misitio.com" class="nav-link Header-link-subscribe Btn-subscribe Btn-subscribe--linear tColorPrContrast tColorSubscribe" style="text-transform: inherit;">Sitio WEB</a></li>');
if (navbarGuest) {
navbarGuest.classList.add('pl-3')
}
</script>
<!-- Fin insertar un link en el Navbar -->
The only thing you will have to modify is what you want the link to say (in the WEBSITE example ) and the URL (in the example https://mysite.com )
3. Click Save and Voila!
If it was not created correctly or an error occurred, pay attention that you have correctly copied the code as we share it with you.
We hope this tutorial has been easy for you. If you have questions, write to us at [email protected] .