Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6515 Lượt xem

Hello-

I am wondering how to increase the size of my website logo that is being hosted on an Odoo v11 CE instance. I was able to find a solution stating to use this code:

<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;"/>

but it never mentioned how or where. I tried going to my website, selecting Customize > HTML/CSS editor > switching to the "main front end layout" page. From what I can tell, this is the code that pulls the logo:

<span t-field="res_company.logo" t-options="{'widget': 'image'}" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name"/>

I tried replacing that with the suggested solution, but no luck.

Thanks for the help!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

this works for me

<img t-attf-src="data:image/*;base64,{{company.logo}}" t-att-alt="company.name" style="max-height: 100px;"/> 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 5 24
4223
5
thg 7 23
18636
Website Logo Size Đã xử lý
1
thg 7 19
7166
1
thg 3 16
7278
1
thg 11 23
3522