This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Introduction

ftw.keywordwidget provides three features:

  1. A widget, which loads select2 for better usability on single and multiselect fields.
  2. A ChoicePlus field, which allows new terms. This is prevents us from making a specific, complicated source, which allow new items.
  3. Render a additional New Entry textarea for new terms.
  4. Uses tags feature of select 2 to add new keywords.

The widget supports schema.Choice, schema.Tuple and schema.List fields.

Primary Use-Case

The widget provides the same functionality as the AT Keywordwidget with some benefits.

Features from the AT Widget:

  • Protect adding new terms by a permission/role
  • Display all possible values
  • Add new terms

Benefits:

  • Configurable select2 widget
  • Sane defaults for the Widget
  • z3c.form Widget
  • Based on the SelectWidget (No new converter, etc. needed)
  • Configurable “add new terms permission” per field/widget possible

Demarcation

There are several other z3c form widgets for plone 4.x, which provides a similar feature set, Like collective.z3cform.keywordwidget, or the AutocompleteWidget.

  • They do not fit the primary Use-Case.

Further you can configure the select2 plugin as you wish.

TODO

  • Implement async option

Compatibility

Plone 4.3.x

Installation

  • Add the package to your buildout configuration:
[instance]
eggs +=
    ...
    ftw.keywordwidget

Usage / Integration

This Widget is not automatically applied to all possible select fields. The idea is that you integrate it where needed by your self.

But for the primary Use-Case mentioned above, there is a behavior:

  1. Install the default profile and the select2 profile if needed.
  2. Enable the ftw.keywordwidget.behavior.IKeywordCategorization behavior on your content type.

For some other Use-Cases you can also enable the ftw.keywordwidget.behavior.IKeywordUseCases behavior. This enables a single and multi select field.

Check behaviors.py for examples:

from ftw.keywordwidget.widget import KeywordFieldWidget


class IKeywordUseCases(model.Schema):

    directives.widget('types', KeywordFieldWidget)
    types = schema.List(
        title=u'Types',
        value_type=schema.Choice(
            title=u"Multiple",
            vocabulary='plone.app.vocabularies.PortalTypes',
            ),
        required=False,
        missing_value=(),
    )

    directives.widget('types2', KeywordFieldWidget)
    types2 = schema.Choice(
        title=u'Single type',
        vocabulary='plone.app.vocabularies.PortalTypes',
        required=False,
        missing_value=(),
    )

alsoProvides(IKeywordUseCases, IFormFieldProvider)

You can configure select2 as you wish by giving a js_config to widget factory.

directives.widget('types',
                  KeywordFieldWidget,
                  js_config={'placeholder': 'Select something...'})

The select2 4.0.3 JS Plugin is shipped with this package. But you it’s not installed with the default profile, because you may already have a select2 JS installed for other purpose. If you need select2 you can install the ftw.keywordwidget Install select2 jquery plugin profile.

Development

Python:

  1. Fork this repo
  2. Clone your fork
  3. Shell: ln -s development.cfg buidlout.cfg
  4. Shell: python boostrap.py
  5. Shell: bin/buildout

Run bin/test to test your changes.

Or start an instance by running bin/instance fg.

Release History

Release History

1.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ftw.keywordwidget-1.1.1.tar.gz (125.3 kB) Copy SHA256 Checksum SHA256 Source Feb 22, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting