Topic: How can I configure choices or categories using extended fields?

Topic type:

Question: How can I configure choices or categories using extended fields?


As with configuring ordinary extended fields, there are a couple of steps necessary to first a) add an extended field, and then b) allocate it to a topic type (or content type).

Let's run through a basic example.

Imagine we are creating a Kete instance for a car club. In addition to the normal fields present on a "Person" topic type, we also want to store the type of vehicle they drive.

Note: You need to be logged in as a site administrator to perform the following steps.

Step 1 - Create an extended field

First we need to create an extended field. We'll call it "Vehicle type" because that should make sense for us and for users.

a) Click on extended fields from the Administrator's Toolbox (you can find this at the bottom of the page when you're logged in as an administrator)

b) Click on Create New from the top right-hand corner of the screen

c) Fill out the fields as appropriate. For Label, we'll put in "Vehicle type", we'll leave Description blank for now, put "dc:description" in XML Element Type, select "Choices (drop-down)" for Ftype (this tells Kete to allow choices we will add later to be selected for the field), and the rest of the fields can be left as they are for now.

When you're doing this in your own Kete, you'll want to tailor the field values to those that are appropriate for your particular usage.

d) Click Create

We now have an extended field that can select choices, but no choices to select from.

Step 2 - Create some choices for the extended field

To define some choices, we'll follow these steps:

a) Click on choices for extended fields from the Administrator's Toolbox

b) Click Create New

c) Enter a Label for the field as appropriate, then Create. We will create fields for "sedan", "coupe", "hatch-back", "station wagon" and "convertable".

d) Also add a couple of "sub-choices" for convertable: "soft-top" and  "hard-top".  Then, click edit at the end of the "convertable" row. Next check the check-boxes beside "soft-top" and "hard-top" in the "Childen" area of the form, then click Update.

What we've done is add "soft-top" and "hard-top" choices as "sub-choices" for "convertable".

Now we need to allocate the choices to the extended field (this would be useful if you needed a couple of extended fields with different choices - you wouldn't want all choices available for all extended fields that accept choices in most cases).

e) Head back to the extended field by clicking extended fields from the Administrator's Toolbox.

f) Click Edit in the "Vehicle type" row.

g) You will see that the choices we've added are selectable by check-boxes at the bottom of the edit form. Click on Expand all (this lets us see all choices including sub-choices), then click the check boxes for the choices/categories you would like to be available for the extended field.

h) Click Update

Step 3 - Allocate the extended field to the topic type

This is the same step as you would need to follow for adding an ordinary extended field to a topic type or content type (images, audio, etc):

a) Click on topic types from the Administrator's Toolbox

b) Click on edit to the right of "Person" from the list of topic types

c) Scroll down and check the (optional) check-box from the Available Form Fields form.

d) Click Add to Topic Type

Further learning

Great! Now you've added choices to an extended field and allocated the field to a topic type. Now when someone edits or creates a new topic of the Person type, they will be presented with a drop-down menu from which they can select choices and sub-choices where available. Play around with creating a new Person topic to see how it works.

You might have noticed that the controls for adding choices, etc offer a couple of different ways for organising or structuring fields and choices and a "autocomplete" option for choice entry. Experiment with adding new extended fields to discover how these can work for users.

Discuss This Topic

There are 0 comments in this discussion.

join this discussion

Creative Commons Attribution-Share Alike 3.0 New Zealand License
How can I configure choices or categories using extended fields? by James Stradling is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License