Configuration and options
Usually, a website has many page types (home, news list, news item, blog...). Maybe all templates have a common zone where several social network icons are shown (one icon loads the company site in Facebook, another the Twitter timeline, etc.). The URL of each social network profile could be a theme configuration so in Navigate CMS the user can set the values without modifying the theme files.
Another simple example is a theme configuration to select the website logo shown in all pages.
Similarly, you can define options related to a certain page type. In the blog entry template, for example, you can define a property called "Blog list image" corresponding to the image that will be shown when listing the blog entries.
The properties/options are defined as JSON objects following this format:
{
"id": "internal code of the option",
"name": "@option_title",
"element": "item|structure element type where the option will be available",
"type": "type of the option",
"dvalue": "default value when option is left empty",
"custom_property": "custom_property_values"
}
A simple example:
{
"id": "logo",
"name": "@logo",
"element": "item",
"type": "image",
"dvalue": "img/logo.png"
}
"logo" is the property identifier that will be used in the templates when requesting the property value. "name" is a text describing the property (can be translated in the theme dictionary) and will be shown in Navigate CMS when editing that property. "type" is the kind of field that must be displayed. "dvalue" represents the default value for the property when the user leaves it empty (the paths in the theme definition are always relative to the theme root folder).
List of property types
name | description | example value | notes / custom attributes |
---|---|---|---|
value | number or single value | 2012 info@yourdomain.com |
the value is not language dependent |
rating | voting result |
5#10 |
default: display 5 stars |
boolean | checkbox | 1 | 1: true / 0: false |
option | select a single value | 3 |
'options': { All option names will be checked against the theme dictionary. |
moption | select multiple values from a select | 3,5 | same format as "option" |
webuser_groups | webuser groups selected | 1,2 | |
country | country selector | us | |
coordinates | select a latitude and longitude (with a map) | 40.689231#-74.044505 |
Latitude#Longitude
|
text | a classic text input field | { "en": "default in english", "es": "default in spanish"} |
multilanguage property, one field for language |
textarea | textarea field | { "en": "default in english", "es": "default in spanish"} |
multilanguage property, one field for language |
rich_textarea | tinyMCE textarea field | { "en": "<span>test</span>", "es": "<span>prueba</span>"} |
multilanguage property, one field for language |
source_code | codemirror textarea field | <div><strong>test</strong></div> | html source code |
color | hex color picker | #FFFFFF | |
date | calendar date picker | 1356139800 | timestamp (time is ignored) |
datetime | calendar date and time picker | 1356139800 | timestamp |
decimal | a numeric value (integer or decimal) | 17.08 | precision (number of decimals) prefix (text added before the input field; f.e. $) suffix (text added after the input field; f.e. €) |
link | link: title and url | { "en": "http://www.navigatecms.com/en##Navigate CMS website in English", "es": "http://www.navigatecms.com/es##Navigate CMS website en Español" } |
multilanguage property, two fields for language (title + url) in the theme definition, the default value for each language is written this way: "link_url##link_title" |
image | image file selector | 325 | id of the file |
video | internal or external video selector |
provider#reference: |
a numeric id without a provider will be taken as an internal video file |
file | file selector | 326 | id of the file |
comment | form comment | { "en": "default in english", "es": "default in spanish"} |
helper text only seen inside Navigate CMS |
category | structure entry selector | 17 | id of the structure entry selected |
element | related element | 8 |
id of the item note: set "element_template" property to only get item's with that template |
0 Comments