Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2286 Lượt xem

Hi guys:


By refering to the component 'pager' at bottom of the website_sale/shop , I tried to t-call its template "website.pager" when I extend the list_renderer view in inheritance mode; 

but the system raises an error  missing template  "website.pager" . 

  • The xml template I extended is as below:

-----------​-----.xml------------------------------------------------------------------------

​<?xml version="1.0" encoding="UTF-8"?>

​<templates id="template" xml:space="preserve"​>

    ​ ​<t t-name="webclient_ext.ListRenderer" t-inherit="web.ListRenderer" t-inherit-mode="extension" owl="1">

        ​​<xpath expr="//table" position="after">

            ​​<div class="products_pager d-flex justify-content-center pt-5 pb-3">

                ​​<t t-call="website.pager"/>

            ​​</div>

        ​​</xpath>

    ​​</t>

​​</templates>​ ​​

        ​--------------------------------------------------------------------------------------------

(Let's just ignore the pager's args(or its props), coz the template  syntax is simply the same as it is in the template addons/website/views/website_templates.xml(line 2499).)

  • The system error raised as below:
OwlError: Missing template: "website.pager" (for component "ListRenderer")
    at owl.App.getTemplate (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:19644:27) (/web/static/lib/owl/owl.js:3250)
    at eval (eval at compile (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:21943:20), :12:30) (/web/static/lib/owl/owl.js:5549)
    at owl.App.getTemplate (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:19654:34) (/web/static/lib/owl/owl.js:3260)
    at new ComponentNode (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:18749:33) (/web/static/lib/owl/owl.js:2355)
    at http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:22172:28 (/web/static/lib/owl/owl.js:5778)
    at ListController.slot3 (eval at compile (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:21943:20), :45:27) (/web/static/lib/owl/owl.js:5549)
    at callSlot (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:19362:37) (/web/static/lib/owl/owl.js:2968)
    at Layout.template (eval at compile (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:21943:20), :46:10) (/web/static/lib/owl/owl.js:5549)
    at Fiber._render (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:18116:38) (/web/static/lib/owl/owl.js:1722)
    at Fiber.render (http://192.168.1.5:9016/web/assets/debug/web.assets_common.js:18108:18) (/web/static/lib/owl/owl.js:1714)


I just want to call the pager component and utilize in other modules' list view,  don't know why it works in website module but cannot be called outside. Please kindly help!


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I think you're trying to mix two different template types:

  • web.ListRenderer it's an OWL (DOM component) template
  • website.pager it's a page template

They're rendered using totally different methods and have different purposes

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 24
1519
4
thg 7 25
1747
1
thg 7 25
971
1
thg 4 25
983
0
thg 3 25
944