Skip to content
haschek edited this page Sep 14, 2011 · 2 revisions

Develop Templates

Preamble: myfoafpressextensions is your folder on the same level with the foafpressapp folder.

$ cd /var/www/yourfoafpressfolder
$ mkdir myfoafpressextensions

Using your CSS with existing templates

Currently it is not possible configure Foafpress to use own CSS/JS files or CSS/JS extensions with existing Foafpress templates. As a workaround you just create your myfoafpressextensions/templates/Foafpress.html.php, importing your CSS and Javascript there. It's not suggested just to edit the Foafpress default CSS files, this would be overwritten with the next Update.

Creating your templates

This is only a short example, using the template for foaf:Group resources. You can get help at the mailing list [email protected].

Copy/Create layout and template files

$ cp foafpressapp/core/templates/Foafpress.html.php myfoafpressextensions/templates/Foafpress.html.php
$ cp foafpressapp/core/templates/foaf/Group.html.php myfoafpressextensions/templates/foaf/Group.html.php

Now edit what you need to change, or create it straight new. Foafpress.html.php defines the global layout, header, footer, and so on. foaf/Group.html.php is the template for foaf:Group resources.

Edit your fp-config.php

$c['template']['folder'][] = dirname(__FILE__).'/myfoafpressextensions/templates/';

That's all. You don't need to copy/create all main/subtemplates to use them. If you don't have the template in your folder, Foafpress uses the default templates.

Clone this wiki locally