ZeroCMS is a scaled down CMS for the everyday programmer.
- Minimalistic: ZeroCMS is basically a Textile (or Markdown) parser + glue
- Lightning fast: Even without caches, i’ve measured something between 5-15ms per request
- Install everywhere: It does not require a database and runs in any PHP >= 5.1 environment out-of-the-box.
Who needs this?
If you don’t want to install a CMS containing tens of thousands of lines of code and providing hundreds of features and tools you’ll never use: you might like ZeroCMS. However, you probably have to be a bit of a geek.
The whole CMS wastes not more then 47kb (cleaned: removed all not used syntax parsers) of your space. The rest is your theme and your contents. In the age of terrabyte-sized hard disks this does not impress that much, but it should draw you a picture of how minimalistic it is.
See it in action
- Download (git, zipped, ..)
- Upload to your webserver in some folder
- Make sure the
content/directory is writable
- Editr the config.php file
- Have a look in the .htaccess file and change the /subdir accordingly
- PHP >= 5.1
See it in action
You can either create/update/delete files directly on the file system or via the admin interface in your browser – or both.
Edit (create/update/delete) the
.tx files directly, upload them to your webspace. Done.
Editing the content is quite simple:
- Edit your config.php, set a username in
ZC_ADMIN_LOGINand your and password in
- Go to the login page (http://yourwebite/login)
- Go to an arbitrary page, click on the “Edit Page” button (default: below the content)
- Edit the content
To create a new page, navigate to the path you want to create, while logged in, and save the page.
Loading/including file parts/snippets
There are two ways to load a partial template into another one.
Loading textile files
Therfore you have to use the
###render directive. Simply state something like the following:
This will look in the content/snippets folder for a file named
filepart.tx . If found, it will be rendered (Textile) and place placed where the
###render directive was.
Loading php files
This requires you to modify an existing or creating a new theme. In the theme folder. Assuming you have a
.php file called “sidebar.php” in your theme folder (eg
themes/mytheme/sidebar.php ), you can load this file in any
.tx file like so:
Setting a page title
If you use the automatic generated navi, you can change the labels used in the navigation. If you don’t, they will default to the file name.
Using titles is quite simple. Put the
###title directive in the first line of your
.tx file (doesn’t have to be in the first line, but parsing will be slower if it has to go till the last line..):
###title My alternative site title
The generated site navi will now use this title instead of the file name.
Page navi position
You can modify the position of the page by prefixing the title with a number and colon, like so:
On the first page
###title 1:I am first
On the second page
###title 2:I am second
Using a table of content (TOC)
This can be done by putting the
###toc directive anywhere. Eg
###toc Some TOC title
ZeroCMS will do the rest..
A default TOC-title can be set in
ZC_TOC_DEFAULT_TITLE in the
Special folders, files
content/snippets folder is somewhat special, because it will not be included in the navi-generation. The general idea is to put here any partial files which you will in include with the
Hidden files / menu items
You can use hidden files, beginning with a dot (“.”). Those can be linked, but will not be included in the navi.
Example: You put a file called
.somefile.tx in the contents folder, now you can reach it via
http://yourdomain.tld/somefile, but it will not be part of the generated navigation.
Creating a custom theme
Best starting point would be to copy the
ugly theme folder. Then edit the
layout.php according to your needs.
Keep in mind
Loading PHP files
You can load
.php files from the themes folder. But keep in mind, that this reduces / breaks the interoperability between themes (your content references a file in a specific theme!).
Because the whole database consists of small .tx files, you can backup them by copying them somewhere else. So, do it.