Skip to Content
मेन्यू
This question has been flagged
748 Views

Tôi dựa vào lệnh từ luồng file trong addon theme_prime : server/addons/theme_prime/views/snippets/s_blog.xml

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<template id="dynamic_filter_template_blog_post_prime_layout_1" name="Prime Layout - 1">
<figure t-foreach="records" t-as="data" class="s_blog_posts_post my-2 w-100" data-number-of-elements="3">
<t t-set="record" t-value="data['_record']"/>
<div class="border">
<t t-set="_cp" t-value="json.loads(record.cover_properties)"/>
<div class="tp-cover-image" t-attf-style="background-image: #{_cp.get('background-image')};">
<div t-if="len(record.tag_ids)" class="p-3">
<span t-foreach="record.tag_ids" t-as="tag" class="m-1 badge text-bg-primary rounded-pill">
<t t-out="tag.name"/>
</span>
</div>
</div>
<figcaption class="text-center w-100 h-100 p-3 d-flex flex-column flex-grow-1">
<h4 class="text-truncate s_latest_posts_post_title mt-3">
<a t-attf-href="/blog/#{record.blog_id.id}/post/#{record.id}" class="tp-link-dark" t-out="record.name"/>
</h4>
<div class="d-flex align-items-center my-2 justify-content-center">
<i class="fa fa-calendar me-2"></i>
<span t-field="record.post_date" t-options='{"format": "d MMMM, yyyy"}'/>
<span class="mx-2">•</span>
<span t-field="record.author_avatar" t-options='{"widget": "image", "class": "rounded-circle tp-blog-avatar"}'/>
<span class="mx-1">Posted by</span>
<span t-field="record.author_id" t-options='{"widget": "contact", "fields": ["name"]}'/>
</div>
<p t-out="record.teaser"/>
<a class="my-2 btn btn-primary-soft" t-attf-href="/blog/#{record.blog_id.id}/post/#{record.id}">Continue Reading</a>
</figcaption>
</div>
</figure>
</template>



</odoo>

Tôi muốn viết kế thừa trong addon website_blog_layout : server/addons/website_blog_layout/views/s_blog.xml


Avatar
Discard
Related Posts Replies Views Activity
2
अग॰ 25
235
2
अग॰ 25
274
2
अग॰ 25
454
0
अग॰ 25
428
1
अग॰ 25
932