我已經創建了自定義的最新博客模板。但我無法在縮略圖中顯示封面圖片。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。 –