How to avoid page menu wrapping
Author: John S.On a site I want to have only the lowest menu-level shown.
I then want navigation from that lewel and up, to be done via the breadcrumb.
As long as the menu is in the header there seem to be no problem that the menu becomes a hamburger as soon as the screen widt cannot hold the normal text.
But when a menu is placed on a page, it starts wrapping, and if you by code specify a height for a menu-item, then it is cou off from right.
I have an example here : https://www.bramminginfo.dk/bramny/index.html
On this page the menu becomes a hamburger as soon as the screen width becomes too narrow.
On this page : https://www.bramminginfo.dk/bramny/billeder.html I have no header. Instead I have the menus stacked, and by scrolling the menus apart from the lowest level "rolls out" to give space. The lowest menu level becomes sticky when it reaches the top. So far so good.
When the screen is resized the menus however, begins to wrap. It is okay on the max-screen where there is place for all the menu text. It is also okay for the lowest screen size where the menus turns into hamburgers. But for all resolutions between that, the menus begins to wrap.
How do I control when the menu should become a hamburger?
It would be really good if you for a page could set which level should be used for the header or sidebar menu. This would make things much easier - it would be like the smart function we had in v.12.
John, perhaps the sticky bar instead of on the page?
I have the same problem John,
i set the overlay menu in the lowest viewport, that would be a good solutions but this has bugs also imho, it does not show levels unless there is a link in it, something that makes no sense in the main menu, but is needed in the overlay menu. So using them both this way would be very nice but due to the levels not being displayed and used as in the normal menu it does not work for me.....
users are now trying to solve this themself.....
https://helpcenter.websitex5.com/en/post/238356
see also:
https://helpcenter.websitex5.com/en/post/237342
It would be nice if these things get sorted out in a way it looks better on websites, specialy the low viewports suffer and these get more and more used by visitors.....
Author
@Esahc - Because of the structure I cannot have a menu in the sticky-bar. And it would not help anyway, as I also need the page menu for the actual level. I use the sticky-bar to create a semi-transparent background. The menu is in the header and is covered by the sticky bar, but I move it forward by using some code (z-index). When a page is specified with no header, I need page-menus.
@Andre - I do not use the overlay menu. And as you describe it has also bugs and apparently only functions for the top-level.
@ - all. Until now I have tried the ideas that popped up in my mind, but nothing solved the lack of controlling the page-menu object/element. Hope someone have a good idea.
@INCOMEDIA - how to solve this problem?
Author
Any suggestions??????????
John, if Incomedia implemented this request (https://helpcenter.websitex5.com/en/post/142629) you could tailor the menu to your requirements (make low res version visible at less than desktop and hide the desktop version).
For the time being however, why not use KolAsim 's code to achieve the same thing (see above link)?
Author
Esahc; I know there can be made code where you test for the screen. I have an example here : https://www.bramminginfo.dk/bramny/billeder.html where I use code to adjust height of an iframe. I have also used it before to hide objects and show another object depending on the resolution.
But as I will probably have many pages where I need to use the page-menu, then It will be troublesome with all that special code.
If this https://helpcenter.websitex5.com/en/post/238832 was made, I could use the header-menu ( where it functions as it should). I would then only use one menu on a page ( always show the lowest level) and the breadcrumb should be used to move upwards. As I cannot control the menu in X5, and as the page-dependant-menu-level is not made - I think I will maybe use the hamburger.
I have a test here : https://www.bramminginfo.dk/bramny/bramming.html
It is not optimal but I think it is the best X5 can offer. If I run into too many problems with the project, I will maybe have to use some other software solution.
What I ask for is a way to prevent the menu from wrapping and become a hamburger instead - according to the viewport.
Author
Anybody???
Hello John
If I understand this correctly, the problem comes from the fact that the Menu auto-transforms into a Hamburger automatically while you would like to have the possibility of having a menu stay open in certain situations.
Is this correct or did I misunderstand the issue?
As of now, the menu should be self-conscious of when it can display the entirety of the pages and when not, but I am not sure I've met a situation where this didn't work as advertised. If the space is enough, it should display
Is this the problem you mention?
Thank you
Stefano
Author
Hello Stafano: It is in fact the opposite. It is when the menu-object that is placed on a page that is the problem.
Instead of turning into a hamburger when the screen gets too narrow, then the menu expands in height and wrap the menu items on several lines.
If I set a height for the object, then the menu items is cut-off from the right when the screen gets narrower - instead of turning into a hamburger.
If the menu is placed in the header, then it acts as it is expected.
Hope you understand this. It should be easy to recreate.
Hello John
Thank you for the clarification, I understand what you mean better now
This is probably due to the fact that the menu in the header also has height constraints. This means that if the width isn't large enough and not tall enough to go vertical, it will turn into an hamburger
On the page instead, the menu will have height space in most cases.
Can you confirm that this is the case? If you give space to the menu in the header vertically but not horizontally, will this happen too?
Let me know
Stefano
Author
Hello Stefano
I can confirm. But it is not the menu in the header that is the problem.
It is the menu on a page. Even if I set a height for the menu ( via styling code), it will not turn into a hamburger. It does not expand vertically then, but it cuts off menu elements from the right - instead of turning into a hamburger as it is expected to do.
Author
@Stefano - is it now more clear what I mean?
How to solve this problem?
Hello John
The issue is clear. I did not mean to say that the menu in the header is the one at fault, but that both menus actually share the same logic. Probably, setting the height via code doesn't work because the logic that makes it possible to contract into a Hamburger doesn't keep that code under consideration and for this reason, it isn't working.
You should try to have a menu on a normal page be very compressed between an Object above and below so that the menu has almost no vertical space. This should let you see what I mean. As of now, I believe that due to this reason the behavior you see in the menu on the page is so different.
Due to the fact that this is technically correct from a coding point of view, I don't think much can be done to change it that wouldn't create possible issues with how the menu currently works in the Header as well
I hope I made the matter a little clearer
Stefano
Author
The problem is not solved - but I will set it as correct, because it is correct that you have no control over a page-menu and when it should turn into a hamburger.
I will make an idea post instead.