PKP Bugzilla – Full Text Bug Listing
|Summary:||Investigate TinyMCE or similar for single-line entries|
|Product:||OJS||Reporter:||Alec Smecher <alec>|
|Component:||General||Assignee:||James MacGregor <jmacgreg>|
|Severity:||normal||CC:||e.manten, jfitz049, jmacgreg, joe, vgabler|
|Version Reported In:||Also Affects:|
TinyMCE config to enable rich text on title fields
Adding title fields to tinymce plugin
builds 2 separate tinymce inits for variable formatting options between fields
Description Alec Smecher 2011-07-12 13:32:30 PDT
Investigate TinyMCE or similar for single-line entries e.g. article titles. Some of these fields permit limited HTML but require the tags to be entered manually.
Comment 1 Erika Manten 2011-08-17 07:20:46 PDT
Dear Alec, TinyMCE is not an option in the title field. I can add html codes in the title field and they are not visible in the table of contents in OJS, but after exporting to DSpace or the DOAJ the title contains the html codes for example 'The <i>Universal Review</i> (1888-1890)'. Our system administrator says we should avoid using italic in the title field (even with TinyMCE, if that was an option) for it would (still) cause this sort of trouble in all kinds of external databases. Thank you for your kind help anyway. Best wishes, Erika (In reply to comment #0) > Investigate TinyMCE or similar for single-line entries e.g. article titles. > Some of these fields permit limited HTML but require the tags to be entered > manually.
Comment 2 Alec Smecher 2011-08-17 08:30:48 PDT
Erika, if we did fully support HTML in titles, we would definitely need to properly strip any included HTML out of titles for use with external tools that don't expect HTML.
Comment 3 Joseph Daddario 2011-10-10 12:27:24 PDT
Comment 4 Alec Smecher 2011-10-11 09:42:34 PDT
Joe, option #1 sounds like the best solution to me -- and would be best suited for contribution back to the TinyMCE community. We could convert <input type="text" /> into <textarea>...</textarea> in our templates, but that seems a little clumsy. Mind investigating a little further?
Comment 5 Joseph Daddario 2011-10-11 10:14:03 PDT
Comment 6 Alec Smecher 2011-10-11 10:16:15 PDT
Better still, Joe -- I guess all that remains is to selectively configure TinyMCE to display a small input for those fields.
Comment 7 Joseph Daddario 2011-10-11 10:34:19 PDT
Yes, but should it always appear?
Comment 8 Alec Smecher 2011-10-11 11:54:16 PDT
Joe, I guess you're asking whether we should accordion out the rich-text editor when the field is clicked? I suspect that's not necessary as long as the editor doesn't look too clunky for these fields; there isn't so many of them that we have to optimize it too heavily IMO.
Comment 9 Joseph Daddario 2011-10-12 13:54:57 PDT
Alec, as I understand, once the TinyMCE plugin is enabled it is "on" for certain textareas throughout the system -- but the user does not have a mechanism to disable/enable this editor for specific textareas, i.e., there is no 'settings' page for the TinyMCE plugin. My thought is that even if they have enabled the plugin (because they wish to have tinymce applied to textareas) the user may not wish to have rich-text controls available for single-line entries.
Comment 10 Alec Smecher 2011-10-12 14:39:02 PDT
Gotcha, Joe. The ability of a text field to accept HTML vs. plain text is cooked into the system, beyond whether or not TinyMCE is presented; we've never hard someone complain that rich text was available somewhere they didn't want it (though we have had to add code to strip tags from places they shouldn't appear). I'm not worried about that.
Comment 11 Joseph Daddario 2011-10-14 07:00:36 PDT
Created attachment 3663 [details] TinyMCE config to enable rich text on title fields In that case the next step is to identify pages where title field appears and assign the field in /plugins/generic/tinymce/TinyMCEPlugin.inc.php. Attached is my first attempt, but someone with a deeper knowledge of workflows should check to make sure none have been overlooked. Presumably we'll also have to designate a distinct set of buttons for title fields as there isn't much sense allowing bullet-ed lists -- will look into this next.
Comment 12 Alec Smecher 2011-10-14 08:25:14 PDT
Joe, can you upload your modifications as .diff files, either using GNU diff or "git diff"?
Comment 13 Joseph Daddario 2011-10-14 11:12:47 PDT
Created attachment 3664 [details] Adding title fields to tinymce plugin
Comment 14 Alec Smecher 2011-10-14 11:31:47 PDT
Joe, make sure you check the "patch" box when you upload the attachment. Looks good so far. See if you can crack the button set / formatting issues next.
Comment 15 Joseph Daddario 2011-10-15 07:23:35 PDT
Created attachment 3665 [details] builds 2 separate tinymce inits for variable formatting options between fields i've extended the $fields array to be multidimensional. each set of arrays off the root represents a unique set of fields which corresponds to unique tinymce configurations.
Comment 16 James MacGregor 2012-03-12 10:12:33 PDT
Deferring. I'm also not entirely sure why this is assigned to me, but I can certainly take a look at it.