Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Changing the default content editor


Go to End


5 Posts   1204 Views

Avatar
Eurisko

Community Member, 27 Posts

18 July 2015 at 12:48am

Hi.
I'm completely new to SilverStripe, but I like what I've seen so far. I've started a new job and had to take over the previous guys development.

The content editor in the admin area isn't like the default one. It looks more like sublime text and has Edit, Add Link, Add Image, Expand and Markdown cheatsheet buttons along the top.

I've decided to start from scratch with a fresh SilverStripe installation so I can get to know their website inside and out. My question is. How do you change the default content editor? I've added modules such as axllent/silverstripe-gfmarkdown but I can only add new fields, not change the content field.

Thanks.

Avatar
swaiba

Forum Moderator, 1899 Posts

18 July 2015 at 3:08am

This will need you to actually take each instance and use http://api.silverstripe.org/3.1/class-FieldList.html#_replaceField to replace it.
There are some classes that I think replace the TextareaField and TextField - but as there is so much going on with the HTMLField in terms of integration I don't think it has an equivalent.

I do agree with you that personally I'd prefer markdown, textile or something as an option over TinyMCE - but I'm not holding my breath.

Avatar
Nightjar

Community Member, 28 Posts

20 July 2015 at 10:39pm

Something may also be possible with Injector, or by specifying some other implementation of the appropriate superclass. IIRC the editor field was engineered in a way where it was supposed to be easily swappable, however ended up ... not quite getting there.
It's still possible, just requires more work I think. You'd have to really look into it though, this is all old memory I'm recalling without checking anything.

Otherwise basically what Swaiba has said. Probably in something like the Page::getCMSFields() superclass replacing all Content field instances in pages easily.

Avatar
swaiba

Forum Moderator, 1899 Posts

20 July 2015 at 11:18pm

According to this description this new module should do exactly as required...

http://addons.silverstripe.org/add-ons/mademedia/silverstripe-markdown

Avatar
Eurisko

Community Member, 27 Posts

23 July 2015 at 8:08pm

Thanks Swaiba. That sent me in the right direction :)