Content
The content and the page hierarchy of the site are stored in an XML file (location/name of this file is specified in the configuration file). Since user-friendly content editor is still under development, you'll have to edit the XML file with your bare hands (or write your own editor ;-)). The structure of the content/page file is described below. This is how minimal file looks like (if you download this CMS, you'll find the content file of this website):
<?xml version="1.0" encoding="UTF-8"?>
<anticms version="0.1">
<info>
<item type="language" code="en" />
<item type="language" code="lt" />
<item type="expires" enabled="true" days="1" hours="0" minutes="0" seconds="0" />
<item type="default" name="language" value="en" />
<item type="default" name="page" value="index" />
</info>
<pages>
<page name="index">
<attribute name="title">
<text lang="en">Home</text>
<text lang="lt">Pradinis</text>
</attribute>
</page>
<page name="other">
<attribute name="title">
<text lang="en">Another page</text>
<text lang="lt">Kitas puslapis</text>
</attribute>
</page>
</pages>
<content>
<item type="string" container="MAIN_TITLE">
<text lang="en">Welcome!</text>
<text lang="lt">Sveiki atvykę!</text>
</item>
<item type="list" container="ARTICLES">
<item type="struct">
<page name="index" subpages="false" />
<item type="string" name="title">
<text lang="en">First post!</text>
<text lang="lt">Pirmas pranešimas!</text>
</item>
<item type="string" name="body">
<file lang="en" name="article_en.html" />
<file lang="lt" name="article_lt.html" />
</item>
</item>
</item>
</content>
</anticms>
anticms element
The top level element anticms contains three elements: info, pages and content. It has one property, version, which indicates the version of document format.
info element
This element doesn't have any properties and contains item elements with general site informaion.
item element
Each item element has type propery and a few other properties which depend on value of type. Possible values of type are:
- language
- Elements of this type are used to specify all the languages website is available in. This is done by specifying language code (eg. 'en', 'fr', ...) in the code property.
- expires
- Element of this type indicates if and when pages expire
i.e. how long they are kept in browser cache. Element properties:
- enabled – if pages expire ('true' or 'false').
- days – after number of days.
- hours – after number of hours.
- minutes – after number of minutes.
- seconds – after number of seconds.
- default
- Elements of this type are used to specify default
values. There are two extra properties: name – name of the
value, and value – the value. Possible names of values:
- language – to specify default language.
- page – to specify default (home) page.
pages element
This element doesn't have any properties and contains page elements, which describe site pages. Direct children of this element are the root pages, and all other pages must be their subpages.
page element
Every page element has property name, which is used to specify page name, and contains a number of attribute elements, and a subpages element.
- The attribute elements' property name specifies the name of this property; the element itself contains data elements (described below).
- The subpages element doesn't have any properties, but contain other page elements, which descibe the subpages of this page.
content element
This element doesn't have any properties, only contains item elements (different from those under info element), that describe the content of the site.
item element
Every item element has the type property, which indicates what elements it contains. Possible type values:
- string
- Elements of this type contain data elements (described below).
- list
- Elements of this type contain other item elements grouping them in ordered lists.
- struct
- Elements of this type contain other item elements grouping them in structures – lists where each item has a unique name. Elements contained in this element must have name property, which specifies the name.
Every item element can contain several page elements, which, indicate the pages where content appears; if there are no page elements, the content appears in every page. Properties of page elements:
- name – name of the page (if the page is a subpage of other page, the name is formed of names of all the pages in the path, seperated by a -).
- subpages – 'true' or 'false' – indicates whether this applies to subpages of this page.
The root item elements must have property container with the name of template variable this content is assigned to.
Data elements
There are two elements to store data with:
- text
- This element contanis plain text – convinient for short text lines.
- file
- This element doesn't contain anything, but has a property name with the name of the file with the text. The file must be placed in the directory specified by configuration.
Both elements have lang property which specifies the language of items' content. If the requested language cannot be found, text is taken from the first available item.
Also, the text is processed as if it was a template before storing on the page.