Froala is the default text editor within Brilliance CRM. The reasons we chose Froala Editor over others are:
<style>{{EDITORSTYLESHEET}}</style>
<script>
new FroalaEditor('#{{EDITORID}}', {
attribution: false,
charCounterMax: {{EDITORMAXCHARACTERS}},
direction: 'auto',
height: {{EDITORHEIGHT}},
heightMin: 200,
heightMax: 500,
htmlRemoveTags: ['script', 'style', 'base'],
htmlSimpleAmpersand: true,
linkConvertEmailAddress: true,
theme: '{{EDITORTHEME}}',
toolbarSticky: true,
useClasses: false,
// Default Toolbar
toolbarButtons: {
'moreText': {
'buttons': ['bold', 'italic', 'underline'],
'buttonsVisible': 6
},
'moreParagraph': {
'buttons': ['ul','ol','hr'],
'buttonsVisible': 6
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'help'],
'buttonsVisible': 6
}
},
// Large Screen Toolbar (≥ 1200px)
toolbarButtonsLG: {
'moreText': {
'buttons': ['bold', 'italic', 'underline'],
'buttonsVisible': 6
},
'moreParagraph': {
'buttons': ['ul','ol','hr'],
'buttonsVisible': 6
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'help'],
'buttonsVisible': 6
}
},
// Medium Screen Toolbar (≥ 992px)
toolbarButtonsMD: {
'moreText': {
'buttons': ['bold', 'italic', 'underline'],
'buttonsVisible': 6
},
'moreParagraph': {
'buttons': ['ul','ol','hr'],
'buttonsVisible': 6
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'help'],
'buttonsVisible': 6
}
},
// Small Screen Toolbar (≥ 768px)
toolbarButtonsSM: {
'moreText': {
'buttons': ['bold', 'italic', 'underline'],
'buttonsVisible': 5
},
'moreParagraph': {
'buttons': ['ul','ol','hr'],
'buttonsVisible': 5
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'help'],
'buttonsVisible': 5
}
},
// Extra Small Screens (< 768px)
toolbarButtonsXS: {
'undoRedo': {
buttons: ['undo', 'redo'],
'buttonsVisible': 4
},
'moreText': {
'buttons': ['bold', 'italic', 'underline'],
'buttonsVisible': 4
}
}
});
</script>
When we added our editors we found that having some variables was greatly needed to streamline and reduce the code as well as provide a more code free environment. As such, below are the fields that are available within the editor:
CK Editor was the first editor we looked at for Brilliance. Due to a lack of styling and control we chose Froala Editor as our editor of choice. A benefit of Brilliance is you can use CK Editor or any editor. We're including the code for CK Editor so that you can use CK Editor or use another JavaScript HTML editor of your choosing.
<script>
const editorConfiguration{{EDITORID}} = {
toolbar: {
plugins: [ 'Autoformat', 'Autoexpand' ],
autoExpand: true,
items: [
'paragraph',
'|',
'bold',
'italic',
'|',
'link',
'bulletedList',
'numberedList',
'|',
'undo',
'redo'
]
}
};
ClassicEditor
.create(document.querySelector('textarea[name="{{EDITORID}}"]'), editorConfiguration{{EDITORID}})
.catch(error => {
console.error(error);
}
);
</script>
Choose from the Knowledge Base category to view the available articles.