[Zope3-Users] custom widgets (IDisplayWidget)

FB fbo2 at gmx.net
Sat Nov 25 03:03:37 EST 2006


On Sat, Nov 25, 2006 at 04:17:24AM +0900, Hassan Alirezaei wrote:
> Hello guys,
> I have a custom widget and I cannot manage to have a custom way of displaying it after 
> editing.
> as far as I know, I should be registering the view for  
> form.interfaces.IDisplayWidget(for display) and form.interfaces.IInputWidget(for 
> editing).
> I use the following zcml lines:
>   <zope:view type="zope.publisher.interfaces.browser.IBrowserRequest"
>       provides="zope.app.form.interfaces.IInputWidget"
>       for="..interfaces.II18N"
>       factory=".widgets.SimpleI18NInputWidget"
>       permission="zope.Public" />
>   <zope:view type="zope.publisher.interfaces.browser.IBrowserRequest"
>       provides="zope.app.form.interfaces.IDisplayWidget"
>       for="..interfaces.II18N"
>       factory=".widgets.I18NSimpleDisplayWidget"
>       permission="zope.Public"  />

This looks familiar :-) .

I don't know, if you used my I18NSimpleDisplayWidget. If you do: I can't
remember ever using this one - maybe it's not working as expected. In most
cases, I needed those multilingual fields in page template which I used
a tales-namespace-adapter for.

I admit that mpgsite.i18n is a mess. I'm currently moving all the i18n-stuff
into a different package (fb) which is much smaller than mpgsite. fb.i18n has
some additional advantages:
   * a special class is used as i18n-container (not a dict anymore). This class
     knows how to extract language versions, does some other fancy stuff and
     behaves like a dict otherwise.
      * One language is marked as the "reference language" now
      * a dedicated class makes it easy to i.e. extract all i18n-objects
        from the *whole zodb* and make some poor guy translate them.
   * Documentation is in english
   * dependencies are clear:
      * fb.fields: for displaying fancy help in edit forms
      * fb.skin's header-viewletprovider which is easy providable by your own skin, too
      * fb.searchengines: for automatically presenting all language versions
        to user agents identified as search engines (I asked a google-guy: It's
        ok to do so).

The fb-package is available via svn here:


The package is not complete, yet. But it will be at the end of the next week.



More information about the Zope3-users mailing list