Forum OpenACS Development: Richtext widget formats

Posted by Andrew Grumet on

On a recent buildout I wanted to hide the various format options on the richtext widget, instead having it always use "Enhanced Text". I like giving the users control but found the richtext widget options confusing (I had to read source to figure out what they did) and maybe too numerous.

So I added a "force_format" option. Here's how you use it within an ad_form -form block:

        {html {cols 50 rows 7}}
        {force_format text/enhanced}
        {nospell ""}
        {label Content}
Should I roll this into the toolkit?

In addition, I think we want to add some help text for the format options, and maybe simplify/reduce/rename them if at all possible. I'm happy to take that task on.

Posted by Lars Pind on
Go for the force_format option. Thanks!

As for a centrally controlled list of formatting options, I think that's a brilliant idea.

All we need is a list of:

- label for the drop-down

- help text (would be nice with a '?' link right next to the format select box, which opens a window listing the formats with helpful examples and help text) -- uh-oh, need to solve our help system issue.

- mime_type for storing the chosen format in the DB

- procs for converting:
  - from the format to HTML
  - from the format to Plaintext

The procs may need to support truncation. I forget the details, even though I just recently revamped how conversion and truncation was done in 5.1

Thanks for your contribution, Andrew.