List Info

Thread: rich widget




rich widget
user name
2006-10-31 08:49:16
"Sandford,Maryellen" <sandfordmcadl.org> wrote:

> Is there anything special about using a rich widget?  I
have this:
> 
> from Products.Archetypes.public import *
> 
> ...
> 
>    TextField('schoolyear_hours', widget =
RichWidget(label = "Body
> text"))
> 
> ...
> 
> But it never renders like the example
> (http://plone.org/documentation/tutorial/p
icking-archetypes-widgets/out-
> of-the-box-widgets).   I just get a plain text field.
> 
> I looked at some of the AT content types code that use
rich widget and
> it looked the same to me.  What am I missing?  thanks

That's odd: when I look at some of the AT content types code
using rich 
widget it looks very different. e.g.

    TextField('text',
              required=True,
              searchable=True,
              primary=True,
              storage = AnnotationStorage(migrate=True),
              validators = ('isTidyHtmlWithCleanup',),
              #validators = ('isTidyHtml',),
              default_content_type =
zconf.ATDocument.default_content_type,
              default_output_type = 'text/x-html-safe',
              allowable_content_types = 
zconf.ATDocument.allowed_content_types,
              widget = RichWidget(
                        description = "",
                        description_msgid =
"help_body_text",
                        label = "Body Text",
                        label_msgid =
"label_body_text",
                        rows = 25,
                        i18n_domain = "plone",
                        allow_file_upload = 
zconf.ATDocument.allow_document_upload)),

Anyway, what you are missing is that you haven't fully
specified everything 
you need for that field. In particular you are using the
default for 
allowable_content_types which is plain text. Ask for plain
text and you get 
a plain text editor. I suggest that at the very least you
specify all of 
default_content_type, default_output_type and
allowable_content_types.


------------------------------------------------------------
-------------
Using Tomcat but need to do more? Need to support web
services, security?
Get stuff done quickly with pre-integrated technology to
make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on
Apache Geronimo
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Plone-Users mailing list
Plone-Userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )