by Nima Mazloumi
+
Enabling WYSIWYGMost of the forms in OpenACS are created using the form builder, see ???. For detailed information on the
API take a look here.
The following section shows how you can modify your form to allow WYSIWYG functionalities.
Convert your page to use ad_form
(some changes but worth it)
Here an examples. From:
template::form create my_form
template::element create my_form my_form_id -label "The ID" -datatype integer -widget hidden
@@ -20,7 +20,7 @@
{after_html
{<a name="#">Anchor</a>}}}
} ...
-
Warning
You must not give your your form the same name that your page has. Otherwise HTMLArea won't load.
Convert your textarea widget to a richtext widget and enable htmlarea.
The htmlarea_p
-flag can be used to prevent
+
Warning
You must not give your your form the same name that your page has. Otherwise HTMLArea won't load.
Convert your textarea widget to a richtext widget and enable htmlarea.
The htmlarea_p
-flag can be used to prevent
WYSIWYG functionality. Defaults to true if left away.
From:
{my_input_field_2:text
To:
@@ -80,7 +80,7 @@
{submit:text(submit) {label "Change"}}
} -on_submit {
parameter::set_value -parameter "UseWysiwygP" -value $enabled_p
- if {![empty_string_p $return_url]} {
+ if {$return_url ne ""} {
ns_returnredirect $return_url
}
}
@@ -95,5 +95,5 @@
set return_url [ad_conn url]
#ADP:
- <a href=configure?<%=[export_url_vars return_url]%>>Configure</a>
+ <a href=configure?<%=[export_vars -url {return_url}]%>>Configure</a>