A design decision I took when updating to Bootstrap 5 was to have the "cart icon" showing at all times in the Navbar regardless of whether the Navbar is "expanded" (ie large screens) or "collapsed" (ie small screens such as mobile phone), as so;
Expanded
Collapsed
I think this looks ideal.
I think it is good UI to always have that cart icon showing.
A design decision has created a bug
- burt
- Core Team
- Posts: 4911
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy A Coffee
- Has thanked: 296 times
- Been thanked: 494 times
A design decision has created a bug
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
- burt
- Core Team
- Posts: 4911
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy A Coffee
- Has thanked: 296 times
- Been thanked: 494 times
Re: A design decision has created a bug
The problem
In the Content Module for the Navbar, shopowner can select to ALWAYS have the Navbar Expanded, put another way it will never Collapse on small screens. This would be ideal for Navbars that maybe only have 2 or 3 items (eg Search, Account, Cart or whatever).
Your Admin > Modules > Content > {select Navigation Bar} > Edit
Here you will see a number of options, the one that matters is "Collapse", which is the breakpoint at which the Navbar, guess what, collapses;
Choosing "navbar-expand" keeps the Navbar expanded.
In the Content Module for the Navbar, shopowner can select to ALWAYS have the Navbar Expanded, put another way it will never Collapse on small screens. This would be ideal for Navbars that maybe only have 2 or 3 items (eg Search, Account, Cart or whatever).
Your Admin > Modules > Content > {select Navigation Bar} > Edit
Here you will see a number of options, the one that matters is "Collapse", which is the breakpoint at which the Navbar, guess what, collapses;
Choosing "navbar-expand" keeps the Navbar expanded.
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
- burt
- Core Team
- Posts: 4911
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy A Coffee
- Has thanked: 296 times
- Been thanked: 494 times
Re: A design decision has created a bug
Choosing this "navbar-expand" option, results in strange effects on the shop side, as so (note that I have removed a few of the Navbar Items (brand, specials, currencies) so that you can more clearly see the effect.
Expanded
This is perfectly fine and looks as expected.
Collapsed
This is not. It has a strange effect of moving the Cart to the left, and being slightly off center.
Expanded
This is perfectly fine and looks as expected.
Collapsed
This is not. It has a strange effect of moving the Cart to the left, and being slightly off center.
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
- burt
- Core Team
- Posts: 4911
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy A Coffee
- Has thanked: 296 times
- Been thanked: 494 times
Re: A design decision has created a bug
Noting that this solution is only for those shopowners who want to use Navbar set to `navbar-expand`, which is likely very very few shopowners!
The Solution
Change the pseudo-code that creates the icons;
After doing this, the Navbar should look correct both;
Expanded
Collapsed
The Solution
Change the pseudo-code that creates the icons;
- Copy \includes\modules\content\navigation\templates\tpl_cm_navbar.php
to
\templates\{your template name}\includes\modules\content\navigation\tpl_cm_navbar.php
and remove (or comment out) this block of code:Code: Select all
echo '<a class="nav-link d-block d-sm-none me-2" data-bs-toggle="offcanvas" href="#offcanvasCart" role="button" aria-controls="offcanvasCart">'; echo sprintf(NAVBAR_ICON_CART_CONTENTS, $_SESSION['cart']->count_contents(), ''); echo '</a>'; - Copy \includes\modules\navbar\templates\tpl_nb_shopping_cart.php
to
\templates\{your template name}\includes\modules\navbar\tpl_nb_shopping_cart.php
and remove this piece of code:Code: Select all
d-none d-sm-inline
After doing this, the Navbar should look correct both;
Expanded
Collapsed
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
- burt
- Core Team
- Posts: 4911
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy A Coffee
- Has thanked: 296 times
- Been thanked: 494 times
Re: A design decision has created a bug
TY to @randers for finding this esoteric bug and reporting it to me.
I will address the bug in a more permanent fashion at some point in the future, but as it will affect hardly any shopowners it can go at the bottom of the list. Attached .zip of the two files above (using `override` template), with cart icon fixed for those of you wanting to use `navbar-expand` on the Navbar.
I will address the bug in a more permanent fashion at some point in the future, but as it will affect hardly any shopowners it can go at the bottom of the list. Attached .zip of the two files above (using `override` template), with cart icon fixed for those of you wanting to use `navbar-expand` on the Navbar.
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
