Version 4 > Developer's Guide > Configurations

Configurations

Configuration files work similarly to v3, with some enhancements:

You can setup an array with only a single element using

conf.setting += foo

(In v3, this appends to a setting; in v4 it initializes an array if the setting is undefined.)

Module config files normally set config settings in the module namespace (eg. foo=1 in Blog.conf actually sets Blog.foo=1). You can access the global namespace in Module config files using "-", for example:

-.content.metadata.profile.organization.datatype = string

Settings

Settings are configuration parameters that can be set either globally, on a content type, or on a specific content object. They can be set in configuration files, or in preferences. For example, blogs have a configurable parameter, index_min, which defines the minimum number of articles that will be shown in a blog index.

To set this globally:

setting.blog.index_min = 3

To set it on a specific blog:

setting.blog:BLOG_ID.index_min = 1   # numeric

or

setting.blog:News.index_min = 1    # by name

You can also put settings into preferences. Use the first form (in this case, setting.blog.index_min), and attach to the preference to either:

  • the content object (the blog) itself
  • the reference object (for instance, an article setting could be put on the blog)
  • the section object

Important/Useful New Configuration Settings

server.fileroot = /var/www/files   # where to install uploaded files

form.jquery_validation = 0  # jquery form validation enhancements (off by default; turn on if your site uses jquery)

report.compact_columns = 10  # switch to compact CSS if there are at least this many columns
report.permission_denied = (no permission to view this data)   # customize column access denied msg

search.skip.library = 1   # skip indexing of certain content types

content.viewdim.normal = 512   # optimal sizes of images
content.posting_date_format = date   # how to display posting dates
content.metadata.page.keywords.datatype = string    # set metadata and its dbmap characteristics*
content.contextual_metadata = 0    # allow content objects to inherit metadata definitions from parent objects
content.flags.form += captcha     # define a flag (boolean metadata)*
content.format.article = ...   # format string for presenting articles*
content.format.article_summary = ...   # format string for presenting article summaries in indexes*
content.format.blog_article_summary = ...   # format string for presenting article summaries in blog indexes*
content.blog.stickiness = temporary     # special config settings for content types*

spacechar = _    # what to substitute for spaces in URLs

queue.start = 10    # when to start pulling things off the queue
queue.end = 16    # when to stop pulling things off the queue
queue.perday = 2    # how many queued items to publish each day

* The setting shown is particular to one content type, but the general format of the setting can be used for any content type.