Fixed Menu Header

I would like that the top menu header remain fixed when scrolling down the content of the pages. It is a pain to have to scroll back to the top just to select another option. This can be easily achieved by just adding this code to the style.css.php file:

div.side-nav-vert {
position: sticky;
width: 100%;
top: 0;
background-color: white;
z-index: 100;
}

Hope this is found useful and be added to future versions.

4 Likes

Hello,

Please log a feature request on the Git:https://github.com/Dolibarr/dolibarr/issues

So it could be integrated to the next version.

br.

Hi Meril,
Thanks for your post. I was wondering where is the style.css.php file?

It is in <dolibarr_root>/htdocs/theme/<your_used_theme_folder>

Good hunting…

Do you think this feature is interesting for the public in general? I say this because of the low ammount of views and the low response of this thread so far.

Hi Merril,
I found that syle.css file and copy pasted the code somewhere into that file but now the display turns all weird. Where exactly should I insert your code in that file?

By the way I think this topic is of interest and may be to alot of people. i had been thinking of the same for a while for having a floating menu.

I think it’s a good improvement,

br

Hi Delcroip,
Where exactly should I insert your code in that file style.css.php?

I would say arround line 949

I have mine in line 1215 of the eldy theme. Take care NOT to put it inside any php coding.

Ex:

/* ============================================================================== */
/* Menu top et 1ere ligne tableau */
/* ============================================================================== */

<?php $minwidthtmenu=66; /\* minimum width for one top menu entry */ $heightmenu=46; /\* height of top menu, part with image */ $heightmenu2=48; /\* height of top menu, part with login */ $disableimages = 0; $maxwidthloginblock = 130; if (! empty($conf-\>global-\>THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } ?\> <<<<<---\- php closing. Line 1213 div.side-nav-vert { <<<<------\- Inserted code. Line 1215 position: sticky; width: 100%; top: 0; background-color: white; z-index: 100; } Hope this help.
2 Likes

Submitted to github.

I have added the suggestion that we could insert the former code conditionally (we have a php file actually) based in the value of a given variable so that one could fix or release the menu at pleasure.

Cheers.

Hey hi, would you please log a feature request to the Git:https://github.com/Dolibarr/dolibarr/issues, so it could be integrated to the next version.
Thank you

Hi AppJetty,
It’s already implemented in version 7.0

hi,

Do you know how to make it sticky when scrolling right ?

br