Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
7081 มุมมอง

I am creating a structure snippet that lists all the blog news from the Blog Module. I am using t-tags (t-set and t-call) to list them up.

The problem is that as soon as I drag that snippet the t-tags transforms into regular HTML code, so I will not get the list updated if a new blog post is created.

My question is how can I use t-tags in snippets without getting it transformed into regular HTML code.


Here is my code:

<div id="news_snippet">

    <div class="oe_snippet_thumbnail">

       <img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_panel.png"/>

       <span class="oe_snippet_thumbnail_title">Blog News</span>

    </div>

    <section class="oe_snippet_body">

        <div class="content">

            <div class="container col-md-4">

                <div class="panel panel-primary">

                    <div class="panel-heading text-center" style="background:#016FAF;">

                        <h2 style="margin: 0; color:#fff;">

                            <strong>Nyheter</strong>

                        </h2>

                  </div>

                <div class="panel-body">

                    <t t-set="blog" t-value="request.env['blog.blog'].search([('name','=','Our News')])"/>

                   <t t-set="news" t-value="request.env['blog.post'].search([('website_published','=',True), ('blog_id','=',blog.id)], order='write_date desc')"/>

                    <t t-call="theme_vertel.news_block_til_sub_dat_txt_vie_"/>

                </div>

            </div>

        </div>

    </div>

</section>

</div>

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
เม.ย. 18
4615
1
ส.ค. 17
5798
1
มี.ค. 15
5156
1
เม.ย. 25
1036
address with ampersand in qweb แก้ไขแล้ว
1
ต.ค. 22
8436