Variable Type HTML Input Field Toolbar Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2023 10:30 AM
Hello ServiceNow Community Team.
I am reaching out to you to ask some advice regarding of "Variable Type HTML Input Field Toolbar Configuration"
This is a input field with HTML Type.
How can I disable and hide those 5 icons in toolbar?
I also checked All > System Properties > UI Properties. with this reference.
But, it seems like it doesn't work. Also, I think if I make changes in system properties, the impact would be global.
I would be really appreciate if you can provide me any advice and guidance to hide few icons in toolbars and how can I apply only specific scope not global scope.
Thank you.
- Labels:
-
Toolbar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2023 08:56 AM - edited 01-07-2023 08:57 AM
As far as I can see the only way to customize the toolbar is by crafting an (let's call it TinyMCE Options) widget and add that widget either to the Catalog Items page or as a variable of type Custom. The widget only needs the Client controller in which a callback is configured with the help of provider uiTinymceConfig:
api.controller = function (uiTinymceConfig) {
uiTinymceConfig.setup = uiTinymceConfigSetup;
function uiTinymceConfigSetup (ed) {
ed.settings.toolbar = ["undo redo",
//"formatselect",
//"bold italic",
//"alignleft aligncenter alignright alignjustify",
//"bullist numlist outdent indent",
//"link unlink",
//"image",
//"codesample code",
].join(' | ');
}
};
I have crafted such a Widget, have added to the Catalog Item page () and the result is that now the HTML editor only displays the two buttons not commented out:
If I uncomment
//"alignleft aligncenter alignright alignjustify",
I get those buttons too:
I guss if you want to set this globally, you can add the widget to the Catalog Item page, or if you want to set the options per Catalog Item, you can use Catalog Item specific configuration widgets. Or craft some mechanism where the configuration is kept in an instance table and the widgets looks it up and applies it when and if so configured.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 03:35 AM
You should also be able to configure this with the sys_properties: glide.ui.html.toolbar and glide.ui.html.editor.v5.toolbar:
In the Value field, enter or remove buttons for each toolbar as a comma-separated list without spaces.
Button purpose Accepted button names
Formatting | newdocument, bold, italic, underline, strikethrough, justifyleft, justifycenter, justifyright, justifyfull, formatselect, fontselect, fontsizeselect, bullist, numlist, outdent, indent, blockquote, forecolor, removeformat, backcolor, sub, sup |
Table functions | tablecontrols |
Editing | cut, copy, paste, pastetext, search, replace, undo, redo |
Extended functions | link, unlink, cleanup, code, hr, visualaid, charmap, image, media, preview, fullscreen (not supported by Internet Explorer) |
https://docs.servicenow.com/bundle/vancouver-platform-administration/page/administer/form-administra...
It should also be possible to configure it for the field it self with editor.toolbar= attribute:
In the Attributes field, input editor.toolbar= followed by the desired toolbar buttons.
For example, editor.toolbar=formatselect|bold italic underline strikethrough blockquote subscript superscript removeformat| bullist numlist outdent indent|undo redo|table hr|link unlink|image media code|visualblocks preview fullscreen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 03:58 AM
Does all that apply to variables?
The links you quote seem to talk about fields.