Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
8 Odpowiedzi
36900 Widoki

I need to change the logo size in my website:

I try changing this:

In the HTML Editor

<?xml version="1.0"?>

<data inherit_id="website.layout" customize_show="True" name="Show Logo">

<xpath expr="//header//a[@class='navbar-brand']" position="replace">

<a href="/" class="navbar-brand logo">

<img src="/logo.png" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" width=200 height=150 />

</a>

</xpath>

</data>


But only i can change the width but not the height.


Some people can help me?


Best Regards.

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Gabriel,

Try this:

<img t-att-src="'/logo.png;base64,'" Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-width: 200px; max-height: 150px;"/>

I hope to help you, regards.

Awatar
Odrzuć
Autor

Thanks Jose! This solution work for me!

Najlepsza odpowiedź

Hello, I am working in Odoo 12, and I want to change the size of the Logo of my website. I am tried different stuff however the logo still with the predefined size.

How can I change that?

Best Regards. 

Awatar
Odrzuć
Najlepsza odpowiedź

Change the Logo size on Odoo

  1. Upload logo to folder /odoo/odoo-server/addons/web/static/src/img

  2. Change default odoo logo file name from logo.png to somethingelse.png

  3. Change yourlogo.png to logo.png (This way you have a high resolution image logo available)

  4. Remember to refresh logo folder ownership by odoo : chown -R odoo:odoo /odoo

  5. Then edit the html code in Main Layout and Show_logo using the html editor like Ermin Trevisan suggested. I had satisfactory results that way.


hope it will help ;)

Awatar
Odrzuć
Najlepsza odpowiedź

Hello Gabriel, what do you mean you can only change the width? 

Odoo will keep the proportions of your logo, see those measures as limits and consider that it will take the one that meets first.

If you're looking to change the proportions you have to use a tool intended for that. 

Awatar
Odrzuć
Najlepsza odpowiedź

override the css:

.openerp .oe_leftbar > div a.oe_logo img {height: 50px;width: 50px;margin14px 0;border0}

header a.navbar-brand img {

max-height: 83px;

height: 100px;

width: 190px;

}

Awatar
Odrzuć
Autor Najlepsza odpowiedź

 

Finally i used this solution propossal:

Thanks a lot!!

<img t-att-src="'/logo.png;base64,'" Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-width: 200px; max-height: 150px;"/>
Awatar
Odrzuć
Najlepsza odpowiedź

Well, the problem is, that changing the size of the logo is only a part of the job. You do also have to adjust the height of the navbar and the vertical alignment of the menu accordingly.

Check http://www.restaurant-roessli.ch

I'm not a developer, so I did that in very nasty way manually using the HTML-Editor (Logo size 100px):

Main Layout:

<body>

<div id="wrapwrap">

<header>

<div class="navbar navbar-default navbar-static-top" style="height:120px">

<div class="container">

<div class="navbar-header" style="margin-top:-17px">

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse">

<span class="sr-only">Toggle navigation</span>

...

Show_logo:

<data inherit_id="website.layout" customize_show="True" name="Show Logo">

<xpath expr="//header//a[@class='navbar-brand']" position="replace">

<a href="/" class="navbar-brand logo">

<img src="/logo.png" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-height:100px"/>

</a>

</xpath>

</data>

Anybody willing to automate that and publishing a small module, which allows to enter the required logo size and then adjusts everything automatically?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 25
783
4
cze 24
6686
0
lut 22
1854
2
paź 17
8094
1
mar 16
7305