Forum .LRN Q&A: Problem getting WYSIWYG editor with richtext widget running

I've read quite a few posts about use of HTMLarea with the richtext widget, to get something near a WYSIWYG editor working on OACS/.LRN. But I'm having problems getting the display buttons (i.e. B U I) to show up in the new richtext widget.

Following Nima's instructions (https://openacs.org/forums/message-view?message_id=198164) somewhat, I still am not sure of the entire process to follow; i.e. what needs to be declared in dotlrn-master.tcl, if anything.

If anyone's been able to get a package working with this editor, could you please let me know what else was included to get it running.

So far I've gone from the original template::form to (trying to) transform it to ad_form then back to template::form, and came up with this:

template::form create new_uos action "uos_add_insert"

template::element create new_uos code \
    -datatype text \
    -widget inform \
    -html { size 50 } \
    -label "UoS Code" \
    -value $unit

template::element create new_uos name \
    -datatype text \
    -html {size 50 } \
    -label "UoS Name"

template::element create new_uos credit \
    -datatype integer \
    -widget select \
    -options {{6 6} {0 0} {2 2} {3 3} {4 4} {8 8} {12 12} } \
    -label "Credit Value"

template::element create new_uos sem \
    -datatype text \
    -widget select \
    -options { {1 1} {2 2} {Both 3} {Not-Offered 4} } \
    -label "Semester Offered"

template::element create new_uos coord \
    -datatype richtext \
    -widget richtext \
    -htmlarea_p "t" \
    -html {rows 5 cols 49 wrap soft} \
    -label "UoS Coordinator Details"

template::element create new_uos tutors \
    -datatype richtext \
    -widget richtext \
    -htmlarea_p "t" \
    -optional \
    -html {rows 5 cols 49 wrap soft} \
    -label "Lecturers/Tutors"

template::element create new_uos aim \
    -datatype richtext \
    -widget richtext \
    -htmlarea_p "t" \
    -optional \
    -html { rows 5 cols 49 wrap soft } \
    -label "Aims and Objectives"

template::element create new_uos d_form \
    -datatype text \
    -html {size 50} \
    -optional \
    -label "Grade Descriptor - Distinction"

template::element create new_uos c_form \
    -datatype text \
    -html { size 50} \
    -optional \
    -label "Grade Descriptor - Credit"

template::element create new_uos submit \
    -widget submit \
    -label "Next ->"

... Which currently gives me an error parsing html tags, in that it doesn't accept variables where I use, for example <i>test</i>

Thanks,
Jon

Collapse
Posted by xx xx on
Hi Jon,

Your code works fine when pasted in a blank document.
I don't get html parsing errors, although I cannot check your "uos_add_insert" page.

You may need to call &lt;master src="blank-master"&gt; and change rows to 6 or more to see the htmlarea. Try in a blank document by calling &lt;master src="blank-master"&gt;&lt;formtemplate id="new_uos"&gt;&lt;/formtemplate&gt;

Did you check the allowedTag and allowedAttribute parameters in the kernel? Do you have code that is "older". Is htmlarea actually available (check blank-master). Is javascript not blocked? ....

BTW, {B I URL} buttons are from the richtext widget not from htmlarea.

[quote]
You may need to call <master src="blank-master"> and change rows to 6 or more to see the htmlarea. Try in a blank document by calling <master src="blank-master"><formtemplate id="new_uos"></formtemplate>
[/quote]

... blank-master isn't defined in my package. Am I supposed to derive it from somewhere else? I've tried setting a field to the size of the screen but that doesn't change it for me.

[quote]
Did you check the allowedTag and allowedAttribute parameters in the kernel? Do you have code that is "older". Is htmlarea actually available (check blank-master). Is javascript not blocked? ....
[/quote]

Currently AllowedAttribute is set to "href" for me, and AllowedTag is: B I P A LI
Javascript shouldn't be blocked, as I have other forms utilizing it (just simple form validation), so it shouldn't be that.

I'm just wondering about what you've mentioned about html being in blank-master. Do I need to download the zip file of htmlarea for this, or ?

Thanks for your help.
Cheers, Jon

Forget my previous post, I've included blank-master from my main dotlrn/www/ directory and it shows up perfectly.

*smacks forehead* here's to my own incredulous incompetency :)

Thanks again!