Odoo Help

2

3
3 Answers
3
Yves Switzerland
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
Hishigbat Mongolia
9/23/18, 11:57 PM

To add on the accepted answer, it's better to use "if website.user_id != user_id else" instead of "if editable". Because when it's "if editable",  if your website has more than one language installed, you won't be able to translate them, because the navbar overlaps the editor navbar. 

My navbar tag: 

<div t-att-class="'navbar navbar-static-top' if website.user_id != user_id else 'navbar navbar-fixed-top'">
0
Avatar

Ricardo Martins Portugal

--Ricardo Martins--
OpenCloud Unipessoal LDA
6591
| 4 2 6
São João da Madeira, Portugal
--Ricardo Martins--
Ricardo Martins Portugal
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. 

Ask a Question
Keep Informed
2 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now