Page 1 of 1

Navbar modules position

Posted: Thu May 07, 2026 9:07 pm
by PiLLaO
Hi,

I'm changing the position of navbar icons, and I can't find how to set it correctly

With icons left, center and right, I don't have problem, but...

If I choose only at the right... are positioned at the left
If I choose only center and right... are positioned left and right
If I choose only at the center... are positioned at the left

adding me-auto and ms-auto seems to works correctly, but no changes for center

Code: Select all

        <?php
        if ($Template->has_blocks('navbar_modules_left')) {
          echo '<ul class="navbar-nav me-auto">' . PHP_EOL;
            echo $Template->get_blocks('navbar_modules_left');
          echo '</ul>' . PHP_EOL;
        }
        if ($Template->has_blocks('navbar_modules_center')) {
          echo '<ul class="navbar-nav">' . PHP_EOL;
            echo $Template->get_blocks('navbar_modules_center');
          echo '</ul>' . PHP_EOL;
        }
        if ($Template->has_blocks('navbar_modules_right')) {
          echo '<ul class="navbar-nav ms-auto">' . PHP_EOL;
            echo $Template->get_blocks('navbar_modules_right');
          echo '</ul>' . PHP_EOL;
        }
        ?>
Maybe someone with more experencie on bootstrap can give me a hand to make this works

Re: Navbar modules position

Posted: Fri May 08, 2026 5:53 am
by BrockleyJohn
For only centred icons, try mx-auto on the middle ul

Re: Navbar modules position

Posted: Fri May 08, 2026 8:02 am
by PiLLaO
Hi @BrockleyJohn

Thanks for your help, not that's I looking for, but it works for me.

I want mix center (search) and right aligment (account, cart) and using me-auto, mx-auto and ms-auto I get some similar

Center aligment near to left, but much better from origin, I think playing adding some extra margin class I get what I looking for.

Thank you so much for your help :)

Re: Navbar modules position

Posted: Fri May 08, 2026 9:07 am
by burt
Navbar is one of the complicated pieces as it does quite a lot of things. Home Left Center Right, collapses into offCanvas etc.

Maybe use all three areas, but have a small fake invisible "." or something in the one that is supposed to have nothing. Don't know if that would have unintended consequences though.