#1 September 2, 2013 8:30am

asiral
Member
Registered: May 18, 2013
Posts: 43

Textareas inside RTE

This might be a limitation of the RTE libraries, but seems like the value could be encoded in a way to avoid this.

Anyway, whenever you insert a textarea inside the RTE, it works as expected but the content is then truncated at the closing of the inner textarea when you edit the page again.

Offline

#2 September 2, 2013 5:23pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 970

Re: Textareas inside RTE

I'm going to add this to our internal bug list and see what I can do about it in the next few days. I'll try to get back to you soon!

Offline

#3 September 3, 2013 10:30am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 970

Re: Textareas inside RTE

A few things:

  • I found an issue (at least in the development branch) where HTML areas weren't htmlspecialchar encoding when drawing, so I fixed that!

  • TinyMCE doesn't seem to behave when typing into a <textarea> element inside the WYSIWYG. If you manually put in tags there like <a> they aren't encoded as < and > and they get broken when they're submitted. If you manually enter the textarea's value as encoded data it should stick between saves.

We're looking at using TinyMCE 4 (and perhaps some other rich text editors as well) as an option in BigTree 4.1, so perhaps that will bring along better compatibility.
Thanks for helping us catch the encoding bug!

Offline

#4 September 4, 2013 3:48am

asiral
Member
Registered: May 18, 2013
Posts: 43

Re: Textareas inside RTE

Hey, Tim:

Glad it's been fixed and happy to hear about TinyMCE in 4.1.  In the meantime, can you point me in the right direction for encoding the textarea values (what files to edit, etc.)?

Thanks!

Offline

#5 September 4, 2013 3:14pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 970

Re: Textareas inside RTE

I think you'll want to edit /core/admin/form-field-types/draw/html.php

Remove the area where it includes textarea.php and replace it with:


<fieldset>
    <? if ($title) { ?><label<?=$label_validation_class?>><?=$title?><? if ($subtitle) { ?> <small><?=$subtitle?></small><? } ?></label><? } ?>
    <textarea<?=$input_validation_class?> name="<?=$key?>" tabindex="<?=$tabindex?>" id="field_<?=$key?>"<? if ($options["rows"]) { ?> rows="<?=$options["rows"]?>"<? } ?><? if ($options["columns"]) { ?> cols="<?=$options["columns"]?>"<? } ?>><?=htmlspecialchars($value)?></textarea>
</fieldset>

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.