Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

Howto use navbar-fixed-top with website navbar

By
Mario Gielissen | Openworx
on 1/29/15, 9:24 AM 3,107 views

How can I let the website navbar stay on top of the screen when scrolling down like https://willowit.com.au?

When I change <div class="navbar navbar-default navbar-static-top"> to <div class="navbar navbar-default navbar-fixed-top">, the menu stays on top. Only problem is that the website editing bar is not correctly displayed when the user is logged in and wants to edit the website.

3
Yves
On 4/16/15, 10:53 AM

The simplest solution is probably to make a switch.

I had tried the user navbar with fixed-top, with fixed-bottom and z-index manipulation. The problem is that there are too many draws more disorders by itself.

I now have it solved so that visitors can see a fixed navbar and backend-user a static navbar. In addition I had to edit only two places in the Main layout:

new opening body 

<body t-att-style="'' if editable else 'padding-top:51px;'">
and a bit further down the new navbar div

<div t-att-class="'navbar navbar-default navbar-static-top' if editable else 'navbar navbar-default navbar-fixed-top'"> 

not an optimal solution - but works so far 

0
Ricardo Martins
On 2/27/15, 11:10 AM

Add this to body tag:

 

body {

min-height: 2000px;

padding-top: 70px;

}

 

The problem is from bootstrap, not odoo. When you fix top, the container adapts, so you need to add the padding, so it restores to the previous size. 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 1/29/15, 9:24 AM
Seen: 3107 times
Last updated: 6/29/15, 4:24 PM