我已经创建了自定义的最新博客模板。但我无法在缩略图中显示封面图片。Odoo博客封面图片不显示
封面图片应该是在这里:
我已经写了下面的代码显示封面图片:
<div class="panel">
<t t-set="properties" t-value="json.loads(post.cover_properties)">
<a class="o_panel_cover" t-attf-href="#{blog_url('', ['blog', 'post'], blog=post.blog_id, post=post)}" t-att-style="background-image: #{cover_properties.get('background-image')};">
</a>
</t>
<div class="panel-heading mt0 mb0">
<h4 class="mt0 mb0">
<a t-attf-href="#{blog_url('', ['blog', 'post'], blog=post.blog_id, post=post)}" t-field="post.name"></a>
<span t-if="not post.website_published" class="text-warning">
<span class="fa fa-exclamation-triangle ml8" title="Unpublished"/>
</span>
</h4>
</div>
写代码的形象不加载,它后如下所示:
如何显示图像?
也如果键入以下内容: ' t-attf-style =“background-image:#{cover_properties.get('background-image')};”' 它说,没有类型的对象没有attrubute get。 –