Data

Datas

Items

Fields

Each item may store one to many informations. These informations are named fields. The fields may contain several sorts of values, like text, numbers or booleans1, who are automatically understood.

The fields may be used to be displayed (like a page content) to filter items (like a user gender), to sort them (like a page date), etc. You can create, remove or edit any fields you want for each data type 2.

The few following fields names are particularly interpreted by the system.

content
in pages, is used to make the RSS feed.
timestamp
a Unix time of the item creation or edition, providing a calendar interface and verified before edition. Used in pages to make the RSS feed.
hide
prevent the item to be found. The item can still be directly obtained, but is not listed by find() method. A page will be absent from pages menus, for example.
parent
the item parent. See Hierarchies.
password
provide adapted interface for edition. Used in users to allow login system.
date, time, email, number, file
provide adapted interfaces for edition.

Hierarchies

Every data may be hierarchical, by indicating its parent. This information may be used for any purpose, from items organization to any complex development. A field named parent will be especially handled by the system for this purpose. It provide a list of items names to chose a parent item, and will be queried to define data hierarchies.

In case of Pages, a hierarchical system allow a simple structuration in different categories, and an easy integration of breadcrumbs and nested menus.

Default types

Thiis propose by default seven types of data : the Pages, the Users, the Settings, the Ranks, the Rights, the Styles and the Templates. Each one is intended to receive a certain type of data, and offer some special managements for this purpose.

Templates

The templates are the brain of the website : they are the only thing that thiis will return when a page is requested, and only them handle what content to display. Generally made of HTML code with some markup to get other datas, like the site title or page content, their paragraphs and line breaks are preserved to respect the HTML structure.

<!doctype html>
<meta charset="utf-8">
<title>{{setting>site_title}}</title>
<article>
	{{page>content}}
</article>

When a page is requested, thiis will return :

  1. the template with the same name
    or
  2. the first template of the list

A simple or uniform website will use a single template using variable contents or different templates for some particular pages, but more complex templates may use PHP development by using any thiis datas or methods. A template system based on the root categories of the website would take a few lines of code :

<? php
	$hierarchy = $this->hierarchy('page', PAGENAME);
	$root = reset($hierarchy);
	if($root == 'category-one') return $this->get('template', 'blue');
	if($root == 'category-two') return $this->get('template', 'green');
	return $this->get('template', 'default');
?>

Pages

The pages are the heart of the website : they are the content included by the templates. Their main field, content, is generally filled of simple text with some markup for formatting and inclusion of other medias :

======= All about tomatoes =======

There is **a lot** of things to say
about tomatoes. They are :
	* great
	* red
	* and juicies

And usually look like that :
{{tomato.jpg}}

The pages define by their names the different entries of a website, all the possible URLs returning contents. If a content is requested from an unknown page, thiis will indicate a 404 message and return, if exists, the content of the page named 404.

Knowing all the pages allow the making of internal links, the listing of pages or the making of feeds to be simple and intelligent.

The page title is defined by its field named title if exists, or by default by its first main header.

Styles

The styles are the eyes of the website : they are the stylesheet included by the templates. Generally made of CSS :

a {
	color: black;
	text-decoration: none;
}
#All-about-tomatoes a:hover {
	color: tomato;
}

This data type is mainly present for organisation purposes, and allow a correct handling with the CodeMirror editor.