![](/img/trans.png)
[英]how to set a default value for the dropdown menu with discord.js v13
[英]How to customize Web-editor Top-menu in Odoo v13?
我创建了一个新模块(“webeditor_custom”)来自定义 Odoo v13 Web 编辑器顶部菜单以在现有菜单项中添加自定义字体大小。
我的模块“webeditor_custom”中的文件是:
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="summernote_cust" name="My summernote assets" inherit_id="web_editor.summernote">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/webeditor_custom/static/src/js/summernote_cust.js"></script>
</xpath>
</template>
</odoo>
odoo.define('web_editor.summernote_cust', function (require) {
'use strict';
var core = require('web.core');
var editor = require('web_editor.summernote');
require('summernote/summernote'); // wait that summernote is loaded
var _t = core._t;
var options = $.summernote.options;
options.fontSizes = [_t('Default'), 8, 9, 10, 11, 12, 13, 14, 16, 18, 21, 24, 28, 32, 36, 42, 49, 56, 63];
return $.summernote;
});
{
"name": "Web editor custom",
"summary": "Add font-sizes to the top-menu of the web editor",
"version": "13.0.2.0.1",
"installable": True,
"depends": ["web_editor"],
"data": ["templates/assets.xml"],
}
安装我的模块后,我在第一次加载我的主页时收到此错误(弹出窗口):
“错误:服务 web_editor.summernote_cust 已定义”
如果您有办法处理它(odoo v13 上的summernote)或解决方法,谢谢
尝试将您的脚本添加到assets_wysiwyg
包中,这样它将在所有Summernote脚本之后添加
例子:
<template id="summernote_cust" name="My summernote assets" inherit_id="web_editor.assets_wysiwyg">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/webeditor_custom/static/src/js/summernote_cust.js"></script>
</xpath>
</template>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.