If you set the data-format on a column, Organizer will apply some appropriate formatting for you.
Certain formats also change how the filter options work; for example if you say that a column is a date, the administrator will be able to filter using a date picker.
Note that you can't use both the format
and item_link
properties together.
Possible options are:
These accept a date or datetime, which needs to be in either UNIX time (i.e. the number of seconds since the 1st of January 1970) or raw MySQL format (i.e. YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).
They output either a date or a datetime, formatted as per the site settings.
Given a value from the list of values defined in the values
property on a column, this will display the display value.
Given a number in bytes, this will format it in KB/MB/GB/TB as appropriate, rounding to one decimal place.
This indicates that this column is an id column. If it is made searchable, only exact matches will be returned (instead of using LIKE as normal).
Given a language code, these will look up and display the English name of the language if it is stored in the system. The language_english_name_with_id option will also add the language code at the end in brackets.
Given the id, directory name or class name of a Module, this will display its display name.
This will remove zero-padding from numbers. It works on strings as well; if a string contains any zero-padded numbers, then the zeros will be removed when the string is displayed.
These format a field depending on whether or not the value is empty.
When searching client-side, it is the formatted values that will be searched on, and not the values before they were formatted.
However when searching server-side it is the raw values in the database that are searched on. If this could cause confusion you should not make this column searchable.
When sorting it is the original values which are sorted on, and not the formatted values.
For some formatting options this could possibly cause some confusion; e.g. Welsh (cy) would appear alphabetically before English (en), which itself would be before Chinese (zh).
Usually when a column is searchable and filterable (columns are filterable unless they have the disallow_filtering
property set) then the default behaviour is a text search.
If a field is a date/datetime field, it will have a date-range picker instead.
If a field is a yes_or_no field, it will have a yes/no picker instead.
If a field is an enum, it will have a list of values instead.
Most of the options will only work on the first word. That means if you have a space in one of your values, everything after the space will be left as-is.
date, datetime and remove_zero_padding are exceptions and will attempt to use your whole value.
format: