This document describes Poster's templating system. Each template file is a PHP script, so any PHP code inside the template file will be executed before replacing the tags.
Using PHP code inside a template is really useful and allows you to create complex templates, but you can create good templates without using a single line of PHP code.
A list of all template files (along with their use) follows.
- template/header.php is included before any other template file. This script contains the first part of the code of your page, the one before the content of the page begins
- template/footer.php is included after any other template file. It contains the last part of the page
- template/archive.php is repeated for any archive entry in the blog archive
- template/archive-archive_spacer.php contains the spacer code between two entries in the blog archive. It is not included after the last entry in the blog archive
- template/category.php is used for any entry in the categories list
- template/category-category_spacer.php is the spacer between two entries in the categories list. It is not used after the last entry
- template/author.php is included for any entry in the authors list
- template/author-author_spacer.php is the spacer used between two entries in the authors list. It is not used after the last author
- template/pager.php contains the blog pager. This file is included after all the posts, but only if the index or a specific page is requested, otherwise it's not used
- template/post.php is the template used for any post
- template/post-post_spacer.php is used to separate two posts. It is not used after the last post
- template/posts-pager_spacer.php is used to separate the posts from the pager. It is not included if there is no need for a pager
- template/post-comments_spacer.php is the spacer between the last post and the first comment. It is not used if there are no comments for that post
- template/post-trackbacks_spacer.php is used to separate the last post from the first trackback. Not included if there are no trackbacks for the requested post
- template/comment.php is the comment template
- template/comment-comment_spacer.php is used between two comments. It is not used after the last comment
- template/comments-form_spacer.php is included between the last comment and the comment submitting form
- template/comment_form.php is the form used to submit new comments
- template/captcha_form.php is the part of the comment form related to the CAPTCHA filter
- template/captcha_image.php is, in fact, not a template file but a script. You should never edit this file
- template/trackback.php is used for any trackback
- template/trackback-trackback_spacer.php is used to separate two trackbacks. It is not used after the last trackback
- template/trackbacks-form_spacer.php is used between the last trackback and the trackback submitting form
- template/trackback_form.php is the form used to submit trackbacks
Tags are used to print parts of the blog on screen.
Each tag has a variable with the same name you can use in
PHP scripts. In a
template file, writing <$BlogUrl$>
or
<?php echo $BlogUrl; ?>
produces exactly the same output.
Both tags and variables are case sensitive.
Below there is a list of all available tags.
- General tags These tags can be used in
any template file
- <$BlogRoot$> is the path to Poster's installation directory
- <$BlogUrl$> is the URL to the blog
- <$BlogTitle$> is the title of the blog
- <$BlogDescription$> is the description of the blog
- <$BlogLanguage$> is the two–digits code of the language
- <$PosterVersion$> is the version number of Poster
- <$UserName$> is the name of the user, if he is logged in, or an empty string
- <$UserLink$> is the link of the user, if he is logged in, or the string "http://"
- <$PostsCount$> is the number of posts in the blog
- <$CommentsCount$> is the number of comments in the blog
- <$TrackbacksCount$> is the number of trackbacks
- <$PagesCount$> is the number of pages in the blog
- <$BlogArchive$> is replaced with the archive
- <$BlogCategories$> is replaced with the categories list
- <$BlogAuthors$> is replaced with the authors list
- Post tags These tags can be used in
template/post.php
- <$PostTitle$> is the title of the post
- <$PostBody$> is the content of the post
- <$PostPermalink$> is the permalink to the post
- <$PostCategory$> is the long name of the category
- <$PostCategoryPermalink$> is the permalink to the category
- <$PostAuthorName$> is the name of the author
- <$PostAuthorLink$> is the link to the author's site, main blog or email address
- <$PostAuthorPermalink$> is the permalink to the author's posts
- <$PostYear$>is the year the post was written
- <$PostMonth$> is the month the post was written (from 01 to 12)
- <$PostDay$> is the day the post was written (from 01 to 31)
- <$PostHour$> is the hour the post was written (from 01 to 24)
- <$PostMinute$> is the minute the post was written (from 00 to 59)
- <$PostSecond$> is the second the post was written (from 00 to 59)
- <$PostCommentsNumber$> is the number of comments for that post
- <$PostTrackbacksNumber$> is the number of trackbacks that post has
- <$PostComments$> is the link to the comments page for the post
- <$PostTrackbacks$> is the link to the trackbacks page for the post
- <$PostId$> is the ID of the post
- Comment tags These tags can be used
in template/comment.php
- <$CommentBody$> is the content of the comment
- <$CommentPermalink$> is the permalink to the comment
- <$CommentAuthorName$> is the name of the comment's author
- <$CommentAuthorLink$> is the link to the author's site or main blog
- <$CommentYear$> is the year the comment was written
- <$CommentMonth$> is the month the comment was written (from 01 to 12)
- <$CommentDay$> is the day the comment was written (from 01 to 31)
- <$CommentHour$> is the hour the comment was written (from 01 to 24)
- <$CommentMinute$> is the minute the comment was written (from 00 to 59)
- <$CommentSecond$> is the second the comment was written (from 00 to 59)
- <$CommentId$> is the ID of the comment
- Trackback tags These tags can be used
in template/trackback.php
- <$TrackbackTitle$> is the title of the trackback
- <$TrackbackExcerpt$> is the content of the trackback
- <$TrackbackPermalink$> is the permalink to the trackback
- <$TrackbackBlogName$> is the name of the blog (or site) sending the trackback
- <$TrackbackUrl$> is the URL to the post
- <$TrackbackYear$> is the year the trackback was recieved
- <$TrackbackMonth$> is the month the trackback was recieved (from 01 to 12)
- <$TrackbackDay$> is the day the trackback was recieved (from 01 to 31)
- <$TrackbackHour$> is the hour the trackback was recieved (from 01 to 24)
- <$TrackbackMinute$> is the minute the trackback was recieved (from 00 to 59)
- <$TrackbackSecond$> is the second the trackback was recieved (from 00 to 59)
- <$TrackbackId$> is the ID of the trackback
- Pager tags These tags can be used in
template/pager.php
- <$FirstPage$> is the link to the first page (index)
- <$LastPage$> is the link to the last page
- <$PreviousPage$> is the link to the previous page
- <$NextPage$> is the link to the next page
- Comment form tags These tags can be
used in template/comment_form.php
- <$CommentFormAction$> is the URL the comment form must be submitted to
- <$CaptchaForm$> is replaced with the CAPTCHA form if the CAPTCHA filter is enabled, and with an empty string otherwise
- CAPTCHA form tags These tags can be
used in template/captcha_form.php
- <$CaptchaSecret$> is the secret word, encrypted
- <$CaptchaImage$> is the URL of the CAPTCHA image
- Trackback form tags These tags can be
used in template/trackback_form.php
- <$TrackbackFormAction$> is the URL the trackback form must be submitted to
- Archive tags These tags can be used in
template/archive.php
- <$ArchiveYear$> is the year of the archived month
- <$ArchiveMonth$> is the month of the archive entry (from 01 to 12)
- <$ArchivePermalink$> is the permalink to all the posts written in that month
- <$ArchivePostsNumber$> is the number of posts written in that month
- Categories list tags These tags can be
used in template/category.php
- <$CategoryName$> is the long name of the category
- <$CategoryPermalink$> is the permalink to the category
- <$CategoryPostsNumber$> is the number of posts in that category
- Authors list tags These tags can be
used in template/author.php
- <$AuthorName$> is the name of the author
- <$AuthorLink$> is the URL to the author's site or main blog
- <$AuthorPermalink$> is the permalink to all the posts written by that author
- <$AuthorPostsNumber$> is the number of posts written by that author
If you think something is missing from this reference, if you have suggestions on how to improve it, if you wrote a template for Poster or a good layout using valid XHTML and CSS, please mail me: eof@kiyuko.org.