Welcome!
This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.
Setando um estilo background-image em qweb Odoo
Esta dica serve para juntar uma variável computada no navegador por <t> a um estilo qualquer, no caso, setar o valor de uma imagem:
background-image: url( " data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ..." );
Considere q i['image'] contem p valor da imagem em base64: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ...
<t t-set="i" t-value="{'id': 10, 'name': 'asdasd', 'address': 'asd',
'tel': 2334234, 'image': 'data:image/*;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...'}
<div t-attf-style=" background-image:url(' #{ i['image'] } ')" />
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!
Keep Informed
About This Community
Moderation Tools
Question tools
Stats
Asked: 9/20/22, 6:01 PM |
Seen: 406 times |
Last updated: 9/20/22, 7:56 PM |