Pixelpost

Authentic Photoblog Flavour

ExtendingPixelpost /

Creating Templates

If you are familiar with HTML and CSS creating your own template is not difficult at all. You don't need to know anything about PHP or MySQL, Pixelpost does all the work for you.

The templates in Pixelpost are normal HTML files styled with CSS. Any interactive code which is built by the scripts for handling your content is placed by Template Tags.
So you can use a common HTML editor for drafting your template. If you are done you should open the file with a normal text editor and replace the varying content parts by template tags.

How does Pixelpost work?

Pixelpost is a photoblog, not a gallery. So in the image page there will be always one photo per page. In default setting it is in a timelined order: the newest published photo is the first one to show, by clicking on "previous" links you browse to the past photos in the queue. Clicking on the "next" links leads you to the newer photos.
Each image page holds the photo, the title of the image, a description, the previous and next links, the comments to this image and other things. Since these things vary on each page Pixelpost script has to call the content for a page each time it is opened. This variable content is inserted by placeholders, so called template tags. You place them within your static HTML code and Pixelpost will replace them with the correct information.

Watch out the list of all available template tags: Template Tags

Different template files are used to create different pages. Default Pixelpost pages within one template are:

  • image_template.html - the page where the image is shown
  • browse_template.html - a page with all images shown as thumbnails
  • about_template.html - a page for static content
  • comment_template.html - a page for the comments if you want to show them in a separate window

Be aware that not all template tags are available on all pages.

If you want to have more pages, just create it, call it newpage_template.html and call it with index.php?x=newpage. But consider that you cannot use template tags here. New pages are always static unless you write your own scripts in an Addon.

If you want to show your blog in different languages, you keep the pages mentioned above as the default language pages and add image_XX_template.html, browse_XX_template.html, about_XX_template.html and comment_XX_template.html for each language you want to have where XX is the language abbreviation.
See here for more information: Alternative Languages

Writing your own template

To start with your own template we suggest you read the template files in simple template which comes with your Pixelpost installation. You see that they look quite like a normal html file. You should better not open them in a WYSIWYG editor since they usually destroy the template tags.

Before beginning you have to consider a few rules though:

  • Use the correct doctype for XTML transitional:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  • Pixelpost is capable of multiple languages which may use special chars. So set the UTF-8 encoding in the metatag:

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

    Tip: If special chars are looking strange, follow the instructions provided here: UTF-8, German Umlauts and other strange chars.
  • If you want to create multilanguage templates, be sure to write static content in the appropriate language. Apply to HTML rules and use HTML entities.

If you have any questions you should look up the Template Tags Section, each template tag is described there showing the HTML code that is replaced with examples given. Also read the Template FAQ section, you will find a lot of answers there.
If you still need help you can always ask in the Pixelpost Forum.

If you are finished perhaps you want to share your work with others. So feel free to upload it into Pixelpost's Extend Section, we are always keen on great new designs!


Page last modified on November 07, 2007, at 08:12 AM