Navbar modules position

Open to all! Ask other shopowners for help.
Post Reply
PiLLaO
Contributor
Posts: 107
Joined: Thu Nov 05, 2020 9:28 pm
Phoenix Version: v1.1.0.6
Has thanked: 53 times
Been thanked: 11 times

Navbar modules position

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
BrockleyJohn
Certified Developer
Posts: 173
Joined: Mon Mar 01, 2021 5:37 pm
Phoenix Version:
Has thanked: 2 times
Been thanked: 30 times

Re: Navbar modules position

Post by BrockleyJohn »

For only centred icons, try mx-auto on the middle ul
PiLLaO
Contributor
Posts: 107
Joined: Thu Nov 05, 2020 9:28 pm
Phoenix Version: v1.1.0.6
Has thanked: 53 times
Been thanked: 11 times

Re: Navbar modules position

Post 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 :)
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Navbar modules position

Post 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.
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply