I’ve done as you suggested and suppressed my unwanted ones like this:
// Hides unneeded buttons from the MD Composer Extras TC
.d-editor-button-bar {
.superscript_button,.subscript_button, .align_center_button,.align_right_button, .align_justify_button {
display: none;
}
}
However, it would be really nice to be able to choose which buttons to include in the TC settings for this. I wonder if this could be done by simply making it so that if there is no text in the setting for a button then it would not be created.
I had a go doing this but it was beyond my meagre skills; I just couldn’t manage to make each bit conditional upon the relevant setting.
Just a thought you could likely have an all in one that uses settings toggles on the advanced version.
ie a Toggle if using bbcode plugin and both could have options to hide buttons or add buttons to bar. With the same if admins want to exclude options in the dropdown.
I am still pretty green learning css. However a complimentary component could likely be made for extra bling to organise the dropdown with cascading dropdown…
ie Main dropdown gear with color option picker.
.
Insert Poll
Insert Table
Text COLOR. >
Red
Green
Blue
Orange
One might be able to group other formatting options in the drop down and/or toolbar to have a menu to choose a formatting option.
Thank you very much for this uncomplicated and featureful component! Very much appreciated.
And a small suggestion, would it be possible to use the Markdown convention of ~~this~~ for strikethrough instead of the more verbose <s></s> convention?
It would be great to have a native option to display the MD composer extras only to specific groups. In our case, we would like to test the extra buttons only for our staff at this point.
For now I hid it by adding body:not(.staff) to nathan’s code:
// Hides unneeded buttons from the MD Composer Extras TC from non-staff users
body:not(.staff) .d-editor-button-bar {
.superscript_button,.subscript_button, .align_center_button,.align_right_button, .align_justify_button {
display: none;
}
}
Next level would be a permission setting for each individual button.
Just a personal opinion, I think we added too many button in the component.
The plugin is more focused on basic functions, the bbcode system is more easy too ([center] instead of [wrap="center"]) but the component is clearly easier to install.
Would it be possible to add a md-composer-extras CSS class to all buttons? My goal is to hide all of them at once for non-staff users and that would make the CSS targeting much simpler.
I’m not sure this is possible, with the example code from the plugin api file, I don’t see a way to add sort of a root class for all these icons. I may be wrong tho
Hey Arkshine! That definitely helps! Yet IMHO it would be a more efficient approach to add a CSS class md-composer-extras to each of the buttons. That way the CSS markup to hide all the elements is super simple