|
Table of Contents
Theming guideThis page will guide you through the process of making your own pluck-theme. You have to know your way around (x)HTML, and some knowledge of PHP would also become handy. Note: this guide is only suitable for pluck 4.5.3 or older! For an up-to-date guide for newer versions of pluck, refer to this guide. Directory structureEach theme has its own directory in data/inc/themes. Your can make your theme in data/inc/theme/blue, for example. There are at least 3 files needed in a theme-directory:
We'll go through these files one by one. The following file is optional:
style.cssThis isn't very difficult: every theme needs a CSS-file. It's important that the name of the file is style.css, because the file will be included in the HTML-code automatically. It's not necessary to include the file yourself. Pluck has some uses a few style-objects to theme some objects. You can use the following objects in your css-file if you wish to enhance your theme further:
theme.phpIn this php-file you specify some important information about your theme. The following two variables need to be included:
The overall code of theme.php should look something like this: <?php $themedir = "blue"; $themename = "Nice Blue Theme"; ?> index.phpThis is the most important, but also the most difficult part. In index.php, you specify all the (X)HTML elements that need to be included in the page. Predefined variablesYou've access to some important predefined variables:
This is all you should need. Now let's start! First, you have to include the file ../predefined_variables.php. Do this like this: include("data/inc/themes/predefined_variables.php");
HTML variablesIn index.php you have to specify the following variables: Note: you have to add a slash before every dubble-quote, otherwise you'll get php-errors. So, " becomes \".
Here you specify the doctype of the page. For example: $html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
Here you have to specify the first tag: the html-tag. For example: $html_start = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
You don't have to fill in this variable, but may become handy if you want to add something inside the head-tags. For example: $html_in_head = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"; note: please use the UTF-8 charset for every pluck-theme you make. This way all special characters will be shown right. You can use the above code to do this.
Here you can add all the html-tags and information before the menu starts. This can be something like this: $html_menu_start = "<div class=\"wrap\"><div class=\"header\">$sitetitle</div><div class=\"menu\">"; note the usage of the $sitetitle variable here
Here you can define with what html-code every menu-item has to start. Link to ?file=$file. For example: $html_menuitem_start = "<li><a href=\"?file=$file\">";
Here you can define with what html-code every menu-item has to end. For example: $html_menuitem_end = "</a></li>";
Here you define the html-code which ends the menu: $html_menu_end = "</div>";
Here you define the code for the title of the page, and you can often use it to open a "content-div" or something like that. Example: $html_title = "<div class=\"content\"><h1>$title</h1><div class=\"txt\">"; note the usage of the $title variable here
Here you define the code for the contents of the page, example: $html_content = "$content"; note the usage of the $content variable here Note: you shouldn't use any markup elements here if you don't really need to. Please insert div elements and such in the $html_title and the $html_footer elements, as shown on this page. This way you can make sure all inserted elements like emailforms and albums show up the way they should.
Here you can add all the remaining html-code, to end the html-elements etc. Example: $html_footer = "</div></div>
<div class=\"footer\">theme made by <a href=\"#\">me</a></div>
</div>
</body>
</html>
resultThis is the html-code pluck generates if we follow the codes above (assumed we have 3 pages: "Home", "About" and "Contact, and we're currently looking at the page "Home", and the title of the site is "Blue"): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home - Blue</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div class="wrap"><div class="header">Blue</div>
<div class="menu">
<li><a href="?file=$file">Home</a></li>
<li><a href="?file=$file">About</a></li>
<li><a href="?file=$file">Contact</a></li>
</div>
<div class="content"><h1>Home</h1>
<div class="txt">These are the contents of the page</div></div>
<div class="footer">theme made by <a href="#">me</a></div>
</div>
</body>
</html>
|