Creating new Widgets
Creating a New Category Widget
Creating a new Category Widget requires an integration between the OpenACS "Categories" package and DynField:
- You have to create a new Category tree for the widget (if it doesn't exist already). Go to the category admin pages at /categories/cadmin/ and select "Create a new tree". Let's call it "Customer Classification" and press OK.
- Select the new tree and choose "Add node at top level" to give it its root node. Let's call the root node "No Classification" and press OK
- Now you can successifly add sub-categories to "No Classification" by clicking on the "Add child" link. For example we might add the sub classifications "A" (= great customer), "B" (= ok customer) and "C" (= customer to get rid of)
- Finally on the category part, we have to find out the "tree_id" of the current tree. To do this, please check the current URL for a "tree_id" piece, which is followed by a number. Perhaps "tree_id" is written as "tree%5fid=630", with the "%5f" representing the underscore "_". However, we need the number behind the "=", so the 630 in this example.
- Now let's go to /dynfield/widgets/ and select "Create a new widget" link at the bottom.
- Let's enter the following data:
- Widget Name = "customer_classification"
- Pretty Name = "Customer Classification"
- Pretty Plural = "Customer Classifications"
- Storage Type = "Normal Value"
- ACS Datatype = "Integer"
- Widget = "Category"
- Datatype = "Integer" and
- Paremeters = "{custom {category_tree_id 630}}" (please replace the 630 by your tree_id)
- That's it. Now you have a new "customer_classification" widget that is available when you define new attributes of an object.