Ticket #2397 (closed defect: fixed)

Opened 9 months ago

Last modified 3 months ago

error in sapphire/forms/HtmlEditorField.php

Reported by: nicolaas Owned by: sminnee
Priority: critical Milestone: 2.3.0-rc1*
Component: CMS - TinyMCE editor Version: 2.2.2-rc2
Severity: medium effort / impact Keywords:
Cc: Hours:

Description

There is an error in the this file on line 291 and 292...

Address is listed twice.

I would remove both! No-one excepts geeks use <pre> as a formatting style. I would much rather see a bunch of other styles defined there.

In trying to edit the tinyMCE options I found that there is really no way... This is a Super limitation for many clients - as this the one of the most important features of Silverstripe - they can edit content!

I would recommend that we include things like "quote", "fineprint", and perhaps the option to add pre-defined classes (which would be the cleanest solution). I realise this is a lot of work.

Change History

Changed 9 months ago by LeeUmm

I would agree. Making it more flexible would be huge and having a drop down list for your own custom css classes/ids would be great. I think it's a fairly big limitation to not include this.

I've also come across some bugs with tiny mce. Not sure if I should split this into another ticket since this does relate to tiny mce.

If you have a paragraph of text, and you highlight one word within it and change the style to a heading X or pre tag etc, it changes the whole paragraph to that formatting.

Also, you can't highlight text and make it a paragraph since paragraph is the default option selected in the list. You'd have to select the text, change it to a different style, then choose paragraph again.

One more thing I'd like to see selected by default is the apply source formatting option. In the .js file for tinymce, there is an option to have it automatically apply source formatting. This makes reading the source easier obviously. The line is: this._def("apply_source_formatting", true);

Changed 9 months ago by nicolaas

In my opinion the best way to extend flexibility is to give users the option to add classes. Question is how you explain it to them and how you keep it simple. Relating to this and also of some annoyance is that the html from the tinyMCE does not actually validate (e.g. images).

Changed 9 months ago by sminnee

  • milestone changed from 2.2.2-rc3 to 2.2.3 feature-lock

Ideally, the tags and classes available should be configured on a site by site basis.

A configuration option where you pass and array would suffice.

By default, TinyMCE has a dropdown for tags and a dropdown for classes. It would be better if we could combine this into a single dropdown.

Something like this

HTMLEditorField::set_styles(array(
  "h1" => "Heading",
  "h2" => "Sub-heading",
  ".highlight" => "Highlighted text (yellow)",
));

If i18n were necessary, the _t() calls could be placed in the config-setting command.

Changed 3 months ago by sminnee

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 2.2.3* to 2.3.0

I've removed the duplication that originally triggered this ticket in r63548; we can save the broader changes for another day.

Note: See TracTickets for help on using tickets.