Creating Skins

From Efiction

Revision as of 03:45, 14 July 2006 by Admin (Talk | contribs)

In theory, there is no limit to the number of skins you can create for your site. If you have created skins for eFiction 1.1, you won't find many differences in 2.0 and 3.0. The number and names of the .tpl files have changed some though in later versions.

Contents

The Basics

The .tpl files

Template Variables

Items in curly brackets are variables, i.e. {output} or {authors}. They contains the actual content that will be printed out on the page. You can surround these attributes with any kind of html that you want -- font tags, tables, whatever. Some attributes are required on some of the template pages, and some are optional.

Certain template variables will only be useable on certain pages or within certain blocks while others can be placed anywhere. The page links are among the variables that can be placed anywhere on any page.

Template Blocks

These are items that generate multiple instances of content in a loop -- for example, in your index.tpl template file, you only need to indicate where the news items should display on the page with the following:

<!-- INCLUDE BLOCK : newsbox -->

This line is telling the script to include the newsbox.tpl file, and the template files will understand that it should print out several news stories in a loop, with just that one line of code.

Another kind of block you may see is the following:

<!-- START BLOCK : categoriesblock --> {category} {description} <!-- END BLOCK : categoriesblock -->

This is another way to include a repeating block of code. In this case, one category in a list of multiple categories.

This is similar to the included block, except that rather than pulling in the block from another file, as in the case of the newsbox.tpl, this one is just defining the block at this very moment. As you read through the individual template file instructions below and look at the actual templates, all of this will make more sense.

Block declarations should go on lines by themselves.

Changes in 2.0

Code Blocks

How to use variables.php

How to use extra_header.php

Converting 1.1 Skins to 2.0

See Converting Skins 1.1 to 2.0

Changes in 3.0

Personal tools