-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rich Text Editor options #1743
Comments
This is already on the General Todo list. #858 That said, I plan to address several issues with RichEditor this week. What sort of buttons would you like to display? |
After #2005, it is now possible to define the toolbar buttons in the form field definition. See Backend > Forms docs for more info.
The available toolbar buttons are:
|
Added support for changing the global default for richeditor buttons. Addresses: #2677, #2384, #2078, #1743 and rainlab/pages-plugin#188
The docs mention you can use the 'inlineStyle' button but can't seem to figure out how to config these styles... Defining them as mentioned at https://www.froala.com/wysiwyg-editor/examples/inline-styles doesn't seem to work in this case.
|
@goeroe you would set that up in the editor settings: http://example.com/backend/system/settings/update/october/backend/editor. Alternatively, you can access the Froala editor directly by extending the DEFAULTS object in JS: +function ($) { "use strict";
$(document).render(function() {
if ($.FroalaEditor) {
$.FroalaEditor.DEFAULTS = $.extend($.FroalaEditor.DEFAULTS, {
inlineStyles: {
'Big Red': 'font-size: 20px; color: red;',
'Small Blue': 'font-size: 14px; color: blue;'
}
});
}
})
}(window.jQuery); |
@LukeTowers I'd like to enable the pastePlain option on Froala to remove formatting - where would JS like your example need to go in an October site? |
put it in a JS file that your plugin extends the Backend\Classes\Controller class to add the script file. |
Example as asked for via email: +function ($) { "use strict";
$(document).render(function() {
if ($.FroalaEditor) {
$.FroalaEditor.DEFAULTS = $.extend($.FroalaEditor.DEFAULTS, {
inlineStyles: {
'Big Red': 'font-size: 20px; color: red;',
'Small Blue': 'font-size: 14px; color: blue;'
}
});
}
})
}(window.jQuery); Extending the backend controller to include your JS file on every backend page (Note, you should be more selective what pages you include it on, i.e. if you just want to add it to your plugin, then extend only your plugin's controllers) public function boot()
{
\Backend\Classes\Controller::extend(function($controller) {
$controller->addJs('/plugins/myauthor/myplugin/assets/js/froala.js');
});
} |
@arashonline please don't hijack old unrelated issues, make new issues instead or ask for help on Slack. |
Hi,
The default rich text editor is very great in backend, but it have not enough option available.
It would be aswome if there were options to choose what is displayed in the toolbar.
For now, I must edit your rich text editor js script to disable media manager buttons.
I see there are 5 options when redactor script is loaded : fullscreen, figure, table, pagelinks and mediamanager. It could be easier if we can modify them directly in the form yaml configuration file.
Thanks for reading,
I love your work !
The text was updated successfully, but these errors were encountered: