This manual is deprecated. Please visit https://groupoffice.readthedocs.io for the latest documentation.

Difference between revisions of "CMS"

From Group-Office Groupware and CRM Documentation
Jump to: navigation, search
(Variables available in the templates)
(Functions)
Line 56: Line 56:
 
To get a list of items from a folder you can use the following command:
 
To get a list of items from a folder you can use the following command:
  
{items}
+
{items}<br />
Dit heeft de volgende parameters:
+
This function has the following parameters. They are all optional<br />
 +
$root_path = Path to the parent folder of the items to list<br />
 +
$root_folder_id = ID of the parent folder of the items to list<br />
 +
$level = Display items of a level in the folder structure. (Path: /Products/Monitors To list the Monitors folder the level is 1, to list the Products folder the level is 0)
 +
<br />
 +
Use one of the above parameters optionally. If they are omitted it will list the items of the active folder. That is the folder of the file that the visitor is currently viewing.<br />
 +
<br />
  
$root_path = het pad naar de hoofdmap
+
$expand_levels = Defaults to 0 if you set a value it will expand into a treeview when a folder is clicked.<br />
$root_folder_id = id van de map waaruit de bestanden gehaald moeten worden
+
$class = Pass a class name to the items.<br />
$expand_levels = hoe diep moet in de mappen gekeken worden (0 is alleen in de $root_folder)
+
$class = het commando {items} kan ook zelf classes samenstellen, geef hier de naam van de class.
+
$level = op welk niveau gekeken moet worden (de map '/root/map' is bijvoorbeeld niveau 1)
+
$item_template = welke template gebruikt moet worden voor het lijstje items (welke .tpl file)
+
$active_item_template = welke template gebruikt moet worden voor het actieve (momenteel geselecteerde) item.
+
$max_items = het maximaal aantal items dat moet worden weergegeven.
+
  
Vervolgens in de cms alle pagina's aanmaken, deze koppelen aan de juiste (zojuist gemaakte) templates en teksten op de pagina zetten.
+
$item_template = Use a sub template file for each item<br />
Door op de knop View te klikken kunt u de zojuist opgezette pagina bekijken.
+
$active_item_template = Use a sub template file for the active item<br />
 +
$max_items = The maximum items to list.<br />
 +
<br />

Revision as of 10:53, 18 February 2009

To enable the CMS you need to install / enable the mod_rewrite module for Apache.

More info about mod_rewrite can be found here: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

You must know the Site ID of the website. This can be found in Group-Office at:

Websites -> Sites -> Double click the site

Then you must add the following rewrite rule to your VirtualHost section:

RewriteEngine On
RewriteBase /modules/cms/
RewriteRule ^(.*)$ run.php?site_id=<The Site ID here>&path=$1&basehref=/


The rewrite base might be different in your environment. Here Group-Office is located in the DocumentRoot.


Variables available in the templates

$file is an array with the following members:

.id = id of the file
.folder_id = id of the file's folder
.extension = file extension
.size = filesize
.ctime = Unix timestamp of the creation time of the file
.mtime = Unix timestamp of the modification time of the file
.name = Name of the file
.content = Contents of the file
.title = Meta title of the file
.description = Meta description of the file
.keywords = Meta keywords of the file

- $folder
.id = of the folder
.parent_id = parent folder id
.ctime = Unix timestamp of the creation time of the folder
.mtime = Unix timestamp of the modification time of the folder
.name = Name of the folder
.disabled = Disabled folder (0 or 1)

- $item
.type = type of the item (folder or file)
.name = name of the item
.title = title of the item
.id = id of the item
.href = URL to the item
.option_values = values from the config.xml that come from the <input>'s

- $cms_url = Path to the CMS module folder in Group-Office

Functions

To get a list of items from a folder you can use the following command:

{items}
This function has the following parameters. They are all optional
$root_path = Path to the parent folder of the items to list
$root_folder_id = ID of the parent folder of the items to list
$level = Display items of a level in the folder structure. (Path: /Products/Monitors To list the Monitors folder the level is 1, to list the Products folder the level is 0)
Use one of the above parameters optionally. If they are omitted it will list the items of the active folder. That is the folder of the file that the visitor is currently viewing.

$expand_levels = Defaults to 0 if you set a value it will expand into a treeview when a folder is clicked.
$class = Pass a class name to the items.

$item_template = Use a sub template file for each item
$active_item_template = Use a sub template file for the active item
$max_items = The maximum items to list.