Forum
Removing default editor options
I'm trying to get my head around the new default editor configuration but failing… I used to comment out lines in the perch/addons/plugins/editors/markitup/config.js file if I didn't want that particular button/functionality to appear in the editor bar, but with Markitup now being built into core, if I do that in /perch/core/editors/markitup/config.js it'll be overwritten when I upgrade perch.
I'm guessing there's something in configuration sets or Custom configurations that I can do to disable buttons, but I'm having trouble working out what.
I guess I'd start by adding define('PERCH_CUSTOM_EDITOR_CONFIGS', true);
to my perch/config/config.php file, and creating a perch/addons/plugins/editors/config.js file. Is it easy to disable name: 'File'
in markdownSettings
's markupSet
from within this file?
You need to write your
Perch.UserConfig.markitup.get()
function to return the MarkItUp configuration you want to use.That defines a
markupSet
property which you can configure however you wish.I think I've got there :)
I'm setting a new set of defaults (without
h1
s and withouttitle
attributes on links). Then if atype="textarea"
has `editor-config="blog" it gets rid of links from the wee menu bar too.Does this code look sensible or could it be more efficient?:
Thanks for steering me in the right direction!
Martin.
If it's working then that's fine.