Content files
From phpCMS
Contents |
[edit] Content files
Content files contain the actual website content. In each case one content file corresponds to one HTML page which shall be shown in the browser. A project can keep arbitrary content files, but a content file can only belong to one project.
[edit] Placeholder (a.k.a. fieldnames)
The contents of such content files are filled in to the according places of the template during parsing. The "according places" are the placeholders which are both exactly the same in template file and content file (checked for identity of names). The phpCMS parser works case sensitive! The placeholder is embedded in the characters which are set in the configuration. By default these are "{" and "}". The placeholder CONTENT has to be written in the template file and in the content file as {CONTENT}. The content which has to replace the placeholder begins directly behind the placeholder in the content file and ends either with the beginning of a new placeholder or the end of file.
[edit] Special placeholders
There are two special placeholders in a content file which cannot be used for own purposes at the moment:
- PROJECT
- This placeholder needs to be the very first entry in a content file and contains the path and name of the according project file. This path can be either be absolute (to document root) or relative (to content file). You cannot use $home in this place, because at this time the project file isn't known yet and $home still doesn't have a value.
- MENU
- Here you can allocate the content file to a specific menu value. This is only necessary, if it's not possible to detect the according menu entry by the filename. You can find further explanation of this issue in the page about the description of the menu system.
[edit] A simple example
As learning by examples is often easier, we would like to give you some little examples. Our example here is the content file, which has been used in the chapter about templates before.
{PROJECT} /demo/template/home.ini
{MENU} 00.01
{TITLE}
A little example
{CONTENT}
This text is written from the content file and is
filled in to the according place in the template.
To show the different structures of content files and that they also can contain other placeholders, here's another simple example. The variable $self is used additionally.
{PROJECT} ../template/home.ini
{HEADING}
A little example
{CONTENT}
This text is written from the content file $self and is
filled in to the according place in the template.
{MORECONTENT}
This is more text. It is only shown, if there is an
according placeholder in the template.
Main Page: User Documentation MainPage
« Previous Page: Content template files | Top Page: How to work with phpCMS | Next Page: How to work with tag files »

