Customising Types and Fields
From ResourceSpace Documentation Wiki
Contents |
Customising Fields
Fields can be customised using "System Setup" in the Team Centre. Expand the "Resource types / fields" node.
Fields are either global, for archived resources only, or 'per type' (i.e. fields for a video). For example resources of type 'Image' will have all the global fields, plus the Image specific fields. If the resource is then archived it will also have the 'Archived Only' fields.
Field Options
When setting up fields in System Setup, the options are as follows:
- Field ID - A unique numerical identifier for the field, automatically created and not editable. You need to use this value when configuring permissions using the 'f' permission.
- Title - The field title as displayed when viewing and editing resources.
- Resource Type - This determines the additional fields that the resource will have. Note that there is no connection between resource type and supported file types. Any file type can be uploaded to a resource regardless of it's type.
- Field Type - Alter the type of field, for example text entry, drop down box, etc. Field types are fairly self explanatory except for category tree which is more complicated; see the section below for more details.
- Options - A comma separated list of options. This is for the drop down and check box types only. Note that removing or altering items on this list after data has been stored against those items will cause orphaned index data. This is fine during initial setup where there is no data, or if you plan to reindex the data manually later.
- Required - if set to yes then the field must be completed before the resource is saved.
- 'Order By - indicates a numerical order for the fields. When displayed on the view or edit page the fields will always follow the order indicated by this field. It is best to leave gaps when setting up fields initially, for example 10, 20, 30, 40 - this way fields can be moved easily without needing to renumber the whole set.
- Index this field - Set to 'YES' to enable indexing, and therefore searching of this field. This must be set before any data is entered - existing data will not be automatically indexed if you change this to 'YES' after data entry. You can reindex manually if necessary. This must be set to 'YES' in order for fields to appear on the advanced search form.
- Shorthand name - when searching via the Simple Search, normally all fields are searched. It is possible however to specify a field to search as follows - "country:spain" which would search the country field only for the value "spain". This option specifies that shorthand name and is usually the same as the title. It must not include spaces and should be alphanumeric only.
- Enable advanced search - set to 'YES' to show this field on the advanced search page. Note this does not work for date types which are not indexed/searchable, with the exception of the default date field which is a special case.
- Enable simple search - set to 'YES' to show this field on the simple search page. Checkbox types will appear as dropdown boxes to save space.
- Use for find similar searching - The keywords indexed for this field will be used for the 'Find Similar' box below the resource view.
- IPTC Equiv. - When using the built in PHP IPTC functionality (i.e. when NOT using ExifTool) this defines the mapping of IPTC keywords to this field. See Metadata_Read/Write_Mapping
- 'Display template - Allows alternative HTML to be used for the resource view page. See the default 'caption' field for an example. Leave blank to use the normal display for this field.
- Tab name - Allows fields to be split over multiple tabs. Leave blank to disable the tab functionality. If you do use tabs you must provide a tab name for EVERY field and the fields must be ordered so that the fields of the same tab are next to each other, otherwise multiple tabs will appear for a given tab name.
- Smart theme name - Automatically generate a Smart Theme section on the themes page based on the data stored for this field. "Fixed" metadata types only, so that means checkbox / dropdown / category tree types. See Customising Types and Fields#Smart_Themes
- ExifTool field - When using ExifTool, configures the mapping between XMP/IPTC/Exif etc. metadata and this field. Many different metadata formats and file formats are supported. See Metadata_Read/Write_Mapping
- Help text - If specified, this text will appear in a box under the field when the field has focus. For checkbox fields and other fields that do not have focus functionality the help box will always appear.
Customising Fields
Fields can be customised using "System Setup" in the Team Centre. Expand the "Resource types / fields" node.
Fields are either global, for archived resources only, or 'per type' (i.e. fields for a video).
Note that any fields that are left blank when editing will not be displayed on the resource view page regardless of the 'Display' setting on the field.
Preventing drop-down menus from auto-selecting the first available choice
When using drop downs, if someone does not select a choice it picks the first choice.
If you start the option list with a comma, you get a blank option first.
Customizing the "Edit resources" form per user group
It is possible to customize the "Edit resources" form where keywords etc. are added to resources, so different groups can select from different sets of keywords when adding searchable keywords to resources. The below permissions can be added to groups in System Setup to control this:
The field IDs appear in System Setup when you edit fields. The permissions are:
f* Can see all fields
f? Can see field with reference ? e.g. f1,f2,f3 (applies to editing, advanced search, and viewing resources).
f-? Cannot see the field with reference ? e.g. f*,f-1 means see all fields except field 1.
Arranging fields over several tabs on the view page
You can set a tab name on fields in system setup and the fields will then be arranged on tabs by matching name. If using the tab feature, all visible fields must have a tab name specified otherwise the tab functionality will not be activated.
You must use 'order by' to make sure the tabs appear together or you'll end up with several tabs with the same name.
The first field encountered must have a tab name before the tab code kicks in. The idea is to set tab names for all visible fields. You can't have some tabbed fields and some not tabbed.
It's also important that grouped fields appear next to each other when ordered by the order field.
E.g.
Order Tab Name ----- -------- 10 Tab 1 20 Tab 1 30 Tab 2 40 Tab 2 50 Tab 3 60 Tab 3 70 Tab 3
The field ordering must be such that fields with the same 'Tab Name' appear together.
The above would produce the following tabs: Tab 1, Tab 2, Tab 3.
An example of how not to do it:
Order Tab Name ----- -------- 10 Tab 1 20 Tab 2 30 Tab 1 40 Tab 2 50 Tab 3 60 Tab 3 70 Tab 3
This is incorrect and there will be the following tabs: Tab 1, Tab 2, Tab 1, Tab 2, Tab 3.
Smart Themes
If you would like a different way to categorize resources using themes you should make one or more Global Fields with its own options list as checkboxes. This will make it possible to choose in which of the themes the resource should be represented. The easiest way of understand how this works is by thinking of this as a kind of category. Each newly created global field represent its own theme group, with options as the grouped themes.
Requirements: This feature requires version 1.5 or newer.
The field names and options in this example is bogus, choose whatever that pleases you.
Step 1. Create a new field in the Root - Resource Types / Fields - Global Fields
- For this guide we just call it 'MainCategory' - Set field type to 'Drop Down List' - Add these options: Nature,Abstract,Architecture,Portrait,Macro,Closeup - Set Shorthand name to: Cat01 - Set Smart theme name (Theme Group displayname) to Main Category - Set 'index this field' to 'yes'
Step 2. Upload new, or re-edit existing resources.
- Edit or upload some resources and set 'Main Category' to Abstract,Portrait or similar. - Verify by navigating to the Themes page.
