common_head.tpl

This module creates the ‘head’ section of the webpage HTML, including the page title, open graph tags (if you are using the Facebook plugin), calls to cascading style sheets, jQuery and other javascript needed to display the webpage properly etc.

It takes no user-defined parameters, and you are unlikely to want to edit it.

 

common_flashplayer.tpl

This module places HTML and/or Javascript on the webpage in order to show an audio or video player on the webpage. It takes no user-defined parameters, and you are unlikely to want to edit it.

It is used inside the postings loop.

 

common_disqus_footer.tpl

This module places some Javascript used by the Disqus commenting system at the foot of the webpage. If you are not using the Disqus commenting system, the module has no effect.

 

common_comments.tpl

This template module places a form to submit comments, and a list of the comments already made, below the text of a posting. Normally, it is called only when the web page contains a single posting; however, the index.tpl template could easily be modified to include comments on pages with more than one post.

The module does not take any parameters to modify its behaviour.

 

Themes and templates

Introduction

PodHawk has eight built-in themes, which determine the appearance of your PodHawk website. You select which theme you want to use on the backend settings page.

In addition, there is a repository of additional themes which you can download. Simply unzip the download package, and place the contents in the folder podhawk/custom/themes in your site. The name of the new theme will appear automatically in the dropdown list in the settings page.

You can modify any of the themes, or create a completely new theme if you wish.

Smarty

PodHawk uses version 2 of the Smarty template engine to make its web pages. If you intend to modify an existing theme or create a new one, you will need to have a basic understanding of how Smarty templates operate. Read the first two parts of the Smarty manual (Introduction, and Smarty for Template Designers). The later stuff on Smarty for Developers is for advanced users only.

In PodHawk, all the html code needed to put your postings on the web page is in template files. The html can be edited freely without the need to alter any of the underlying php. The Smarty template files are written as html with additional Smarty variables and functions. These are contained in curly braces {like this}. Smarty variables all begin with a dollar sign. Some of them are simple values e.g $next_page; but more often Smarty variables are arrays. You can access the different levels of the arrays by separating them with a period sign e.g. $settings.url contains the url of your web site. There are powerful conditional (“if….”) and looping (“foreach…”) functions in Smarty which make it possible to control the detail of what appears on your web page.

If you open up one of the PodHawk theme folders (podhawk/custom/themes), you will see that it contains several different sorts of file:

  • some Smarty template files, with the file termination .tpl.
  • a configuration file, with the file termination .conf.
  • one or more cascading style sheets (css), which tell the web browser how you want the web page to be displayed, what colours and fonts you want to use etc.
  • a couple of flash objects, with the file termination .swf. These are the classic LoudBlog Flash players for the theme.
  • an images folder. This contains images used directly by the templates (eg background images, icons). The images which you load to use in your postings are not here, but in the images folder in the root of your PodHawk installation.
  • a lang folder which contains the language translation files.

Modular templates

The main template file is index.tpl. If you open it (in a text editor, never in a word processor), you will see that it ‘includes ‘ other template files. In other words, it is constructed of modules. It is possible to move these modules around in the template, or to remove them or to add new modules.

Some of the module files are .tpl files in your theme folder. Most of them however are in a separate folder “common_templates”, where they can be accessed by any of the themes. (Where index.tpl has statements like {include file=“common:posting_categories.tpl”}, it is calling a module from the common_templates folder). Template files in the common_template folder all have names which start “common_” eg “common_head.tpl”. This is simply to stop Smarty from confusing them with files in the theme folder.

index.tpl contains a posting loop. This begins with

{foreach from=$postingdata key=key item=posting name=postings_loop}

and ends with

{/foreach}

The posting loop takes each of the postings to be displayed on the page and places information about it – such as the title, the author, the text of the posting and any tags attached to the posting – on the web page. Most of the modules within the posting loop have a name which begins “posting_” eg “posting_title.tpl”.

If your theme contains a sidebar, index.tpl will “include” a file called “sidebar.tpl” (or two files “sidebar_left.tpl” and “sidebar_right.tpl” if there are two sidebars in your theme). sidebar.tpl in turn “includes” modules, generally from the common_templates folder, with names that begin with “sidebar_” eg sidebar_authors.tpl.

In many cases, it is possible to pass parameters to modules, which affect how they behave or what information they place on the webpage. For example:

{include file=‘common:sidebar_tagcloud.tpl’ number=5}

places a tagcloud in the sidebar. The “number” parameter tells the module how many tags (starting with the most important) to display.

For fuller descriptions of the modules available in the common_templates folder, click the links below.

Modules to use inside the posting loop:

Modules to use in a sidebar
I could not find any posts with tag tpl_sidebar

Modules outside the posting loop and the sidebar

Other postings about themes and Smarty templates