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

Hello

I am trying to add a new button in "editorbar", inheriting web_editor, but without having any result, this is my qweb code:

<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
    <t t-extend="web_editor.editorbar">
        <t t-jquery=".btn btn-primary btn-xs" t-operation="before">
            <span>OK</span>
            <a href="#" data-action="custom_action" class="btn btn-primary btn-xs">Custom Action</a>
        </t>
    </t>
</templates>


Can someone give me a hand, thank you.

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

Since version 9.0 web_editor is based on Summernote (version 6.x I guess) See https://summernote.org/

Odoo integration change various things, notably the config which is in the file web_editor/static/src/js/backend.js That means that you must load your changes and templates with Javascript. 

Look at the OCA web_editor_background_color module for a sample.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
1715
1
thg 5 25
1715
1
thg 4 25
2284
1
thg 2 25
1569
0
thg 10 24
1323