This template is used to define the structure of your website. Ariadne knows many types of objects. When an editor wants to create a new page in the website, the full list of object types makes it difficult to decide what type to select. In addition your templates may assume a certain structure in the sites content hierarchy, e.g. top level is psite, second level psection and further levels pdir and ppage.
With this template you can define just which types of object an editor has to choose from depending on the type of the parent. In addition you can also define new derived object types, usually called 'subtypes'.
The template has three special variables which allow you to specify the type tree, (sub)type icons and (sub)type names:
(array) |
$arTypeTree |
This variable defines the content type structure or typetree. Its format is: array( [parent-type] => |
(array) |
$arTypeNames |
This variable defines the name of each (sub)type. The format is: array( [type] => [name] ) |
(array) |
$arTypeIcons |
This variable defines the icons for each (sub)type. Its format is: array( [type] => |
Example 1: defining a new typetree.
<pinp>
$arTypeTree = ar::getvar('arTypeTree');
$arTypeTree = array(
'psite' => array(
'psection' => 'Section'
),
'psection' => array(
'pdir' => 'Directory',
'ppage' => 'Page',
'pfile' => 'File',
'pphotobook' => 'Photobook'
),
'pdir' => array(
'pdir' => 'Directory',
'ppage' => 'Page',
'pfile' => 'File',
'pphotobook' => 'Photobook'
),
'ppage' => array(
'pfile' => 'File'
),
'pphotobook' => array(
'pphotobook' => 'Photobook',
'pphoto' => 'Photo'
)
);
ar::putvar('arTypeTree', $arTypeTree);
</pinp>
Example 2: adding a subtype.
<pinp>
$arTypeTree = ar::getvar('arTypeTree');
$arTypeTree['pdir']['ppage.contact'] = 'Contact Page';
ar::putvar('arTypeTree', $arTypeTree);
$arTypeNames = ar::getvar('arTypeNames');
$arTypeNames['ppage.contact'] = 'Contact Page';
ar::putvar('arTypeNames', $arTypeNames);
$arTypeIcons = ar::getvar('arTypeIcons');
$arTypeIcons['ppage.contact'] = array(
'default' => ar('loader')->
makeURL('/lib/contact/images/contact.png', false, false),
'small' => ar('loader')->
makeURL('/lib/contact/images/contact_small.png', false, false)
);
ar::putvar('arTypeIcons', $arTypeIcons);
</pinp>