Document Types
The document types system lies at the core of dotAdmin, and is one its key strengths. When creating a new page on your website, the user can select from a range of predefined "document types" which will have different editable fields, different display templates and different behaviours.
By creating and customising document types for your website, you can make managing different kinds of content as easy as possible for the end user, protecting the website editor from making simple mistakes during document creation, and simplifying their workflow. Essentially, the document type system allows the website developer to create simple document edit forms where the fields of the editor are organised into tabs, with the essential information edited on the first tab, and more complex and detailed fields moved into the later tabs in the edit interface.
dotAdmin document types use a simple, easy to use structure as follows:
- tab
- caption - a text title for the document editor tab
- fields
- name - the name which will be assigned to this document property (eg "document_title")
- caption - the text caption used for this field in the editor
- type - dotAdmin offers a range of field types:
- text - a simple single line text field
- longtext - a multiline text field
- bool - a boolean value
- html - an HTML field with WYSIWYG editor
- link - a link field (with link browser widget)
- image - an image field (with image browser widget)
- imagemultiple - a multi image field allowing one or more images to be added as an array of images (with image browser widget)
- select - a drop down selector
- selectother - a drop down selector with an "OTHER" value which exposes a single line free text field
- multiselect - displays a multiselect widget
- range - displays a numeric range selector
- heading - prints out a the caption value as a heading (requires only a caption value)
- selectivenavplacement - this will place a link to this document in the selecting nav $name
- tag - presents the document tagging interface
- fieldgroup - a fieldgroup contains other fields within in it, allowing the groups of fields to be repeated multiple times
- [module].[type] - custom field types may be available in specific modules. These can be accessed as [module].[type]
- default - the default value for this field. This will be prepopulated when a new document is created by the user.
- options - for "select" or "selectother" types, a range of values can be specified here as follows:
- value - the option value
- caption - the option caption
OR
- select - use an internal function or SELECT query to fetch results from the database, such as:
- getNodes - get a list of all nodes in the site database
- getDocuments - get a list of all nodes in the site database
- getCountryCodes - get a list of all countries (by country code)
- getCustomers - get a list of valid customers
- getUsers - get a list of valid customers
- A query constructor, eg:
- value - field to use for value
- caption - field to use for caption
- table - table to select from
- where - WHERE criteria
- order - ORDER BY criteria
- start - "link" type fields can be told to open the link browser in a particular node in the hierarchy (by id) or in "media" or "privilegedmedia"
- allowtextentry - (BOOL) default: false - "date" type fields can either accept text entry into the field, or require use of the datepicker.
- height - (TEXT) default: null - a height in pixels for "longtext" type textarea fields.
- is_node - (BOOL) - when set to true, values selected in this field will be added to the document's node links. Usually used in conuction with "select" or "multiselect" type fields with options from the "getNodes" function.
- is_tag - (BOOL) - when set to true, values in this field will be added as documentags. Usually used in conuction with "select" or "multiselect" type fields.
- fields - (ARRAY) - an array of fields included in the fieldgroup. Only applies to fieldgroup fields types.
- rows - (ARRAY) - a fieldgroup can also contain a grid of rows and cols with fields within them.
- usefortitle - (BOOL) - fieldgroup items need text for their title bar in the editor. The value of a field will be used in the group item title bar if "usefortitle" is set to true
- priv - (STRING / ARRAY) - either a string or an array of strings, with the name of privs one of which the user must have in order to edit this field.
- trackchanges - (BOOL) - will changes to this field be tracked in the ${file}change table?
- rows - fields can be grouped in to rows and columns
- cols - cols within a row. Will contain:
- width - the interface used a 12 column grid. The "width" attribute will be between 1-12 as a division of the 12 column grid. Eg: width = 6 will mean that the cloumn uses half the screen with, width = 3 will use a quarter.
- fields - collection of fields as described above