Hi
It's not an issue, but a feature idea/request (not sure if this is the right way, if not, please let me know).
I'd like to give the user the option to format a part of the text as paragraph and others as h2 or h3. h1 and blockquote should be forbidden however, as they fuck up the design.
I solved this the "hacky" way, by just removing them at t.btnsDef.formatting.dropdown. It would be great to have a proper way of doing this. Maybe the formatting options could be moved to t.o or be overwritten by stuff saved there.
Thanks (:
Hey !
You should create your own formatting dropdown, not modifying the existing one. If you do that, it's not hacky :)
Check it out: https://github.com/Alex-D/Trumbowyg/blob/develop/index.html#L85
Tried it and it works like a charm. I'm using:
jQuery('textarea[wysiwyg]').trumbowyg({
btns: ['customFormatting', '|', 'bold', '|', 'link', '|', 'unorderedList', 'orderedList'],
btnsDef: {
customFormatting: {
dropdown: ['p', 'h2', 'h3', 'h4'],
ico: 'p'
}
},
});
Maybe, you could add a tutorial on the documentation page.
Awesome work and feel free to close the issue, thanks (:
Most helpful comment
Tried it and it works like a charm. I'm using:
Maybe, you could add a tutorial on the documentation page.
Awesome work and feel free to close the issue, thanks (: