File Types and Export

Whether and how a file is exported is already determined by its type, which is part of the file format used for the file. When files of the types Folder, Document, Image or Resource are exported, a corresponding output file is created for each file. Files of the Layout type are not exported.

Files of the Image or Ressource type are not exported using layouts. Instead, they are exported as they are, unmodified. Image files hold the images that were imported into the CMS. Resources can have any content and are mostly offered to the visitor of your website for download (e.g. PDF files).

The Difference between Folders and Documents

In contrast to documents, folders can have subfiles and thus help to structure your website. A folder on your website can function as a start page with references to, for example, subordinate pages. However, with regard to their contents, there is no difference between files of these two types.

The output file of a folder and a document normally corresponds to a web page. However, when exporting files of these types, the CMS does not simply create a file containing the main content of the released version of the CMS file. Instead, it uses a layout file for the export, the base layout.

Function of the Base Layout

The base layout is a special exemplar of the Layout file type. Usually, it consists of HTML text and export instructions. When exporting a folder or a document, the Content Management Server processes the base layout like a program to create the corresponding output file. The HTML text contained in the layout file is written to the output file unchanged. Using a special tag, the NPSOBJ instruction, you can instruct the Content Management Server to export field values such as meta tags or the main content of a released version, for example. If the appropriate instructions are missing in the base layout, the file is exported incompletely.

If several base layouts exist (e.g. one for the pure text, one for the complete current layout, and one for the relaunch) every user can specify his individual base layout in his personal preferences. This makes it possible to simultaneously work with several layouts of the same website. In the Content Management Server default installation, there is only one base layout file which is simply named mastertemplate. Base layout files are often contained in the base folder.

Layouts Make Use of Other Layouts

Typically, the base layout file references further layouts. When exporting a file, the Content Management Server first searches for a referenced layout in the folder containing the file. If the layout does not exist, it searches for it upwards in the folder hierarchy, towards the base folder. This mechanism makes it possible to use local layouts, which are only effective in subsections of your website.

Layout files are the ideal location for layout and navigation elements that are to enclose the main content. As a result, they are a means by which you can efficiently create a website with a homogenous layout. The procedure with which the CMS, i.e. the Content Management Server and the Template Engine, searches for layout files during the export gives you additional support in creating website areas with individual layouts.