콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

In my odoo module, I want to add more font size options when I edit a text in the website editor.

I have tried the following template:

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

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


    <t t-extend="web_editor.toolbar">

        <t t-jquery="#font-size ul li:nth-child(7)" t-operation="after">

            <li>

                <a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="16px">16</a>

            </li>

        </t>

        <t t-jquery="#font-size ul li:nth-child(9)" t-operation="after">

            <li>

                <a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="20px">20</a>

            </li>

            <li>

                <a class="dropdown-item" href="#" data-call="setFontSize" data-arg1="22px">22</a>

            </li>           

        </t>

    </t>

</templates>'''


And the following JS:
'''odoo.define('jt_webeditor_extras.toolbar_extras', function (require) {

    'use strict';


    const Toolbar = require('web_editor.toolbar');


    Toolbar.include({

        xmlDependencies: (Toolbar.prototype.xmlDependencies || []).concat(

            ['/jt_webeditor_extras/static/src/xml/editor.xml']),

    });


});'''


Any other ideas to implement more font sizes?

아바타
취소
관련 게시물 답글 화면 활동
3
8월 25
933
3
7월 25
386
2
7월 25
1053
1
5월 25
803
0
5월 25
953