Templates: Archive Lists

The archive lists are formatted as listed below:

archivelist header
  archivelist listitem (repeated for each archive)
archivelist footer

Available variables: (in the header and footer, only blogid is allowed)

Name Description
blogid ID of the weblog
archivelink link to the archive, which you can embed in a <a href=".."> tag.
month Number of the month (2 digits: 01-12)
year Year (4 digits)
day Day of month (2 digits; only when in day mode)

A more flexible way to add the date of the archive to the listitem, is to use strftime variables. If you find this too complicated, use the following:

<a href="<%archivelink%>">%B, %Y</a><br />

To change the language to your local settings, change the locale.

Template Items - Permalink

Templates: Category Lists

The category lists are formatted as listed below:

categorylist header
  categorylist listitem (repeated)
categorylist footer

Available variables: (in the header and footer, only blogid, blogurl and self are allowed)

Name Description
blogid ID of the weblog
blogurl URL of the blog (as defined in blogsettings)
self Current page, without parameters (e.g. index.php)
catlink a link to the most recent items for a category, which you can embed in a <a href=".."> tag.
catid Category ID
catname Category name
catdesc Category description

View an example

Template Items - Permalink

Templates: Category Lists Example

Examples of category lists are:

Header

<ul>
  <li><a href="<blogurl%>">All</a></li>

List Item

<li><a href="<%catlink%>"><%catname%></a></li>

Footer

</ul>

Results in:

Template Items - Permalink

Templates: Comment body

This is the part of the template used to display a single comment. In this template-part, comments-related templatevars are available.

Example

<h2>Comment by <%userlink%>:</h2>
<p><%body%></p>

<div class="metadata">
 (from <%host%> on <%date%> at <%time%>)
</div>

Result:

Comment by karma:

Nice!

(from host.example.org on 2003-03-02 at 13:30)

Template Items - Permalink

Templates: Comment headers/footers

Description

While the comments-body is repeated for each comment, the header and footer are only displayed once. A typicall structure would look like this:

comments header
  comments body 1
  comments body 2
  comments body 3
comments footer

In these template-parts, comments-related templatevars are available

Examples

Header:

<ul>

Body:

<li><%user%>: <%body%></li>

Footer

</ul>

Result

  • karma: nice!
  • xiffy: yes indeed!

Template Items - Permalink

Templates: commentword

Most likely, you'll rather want to write "1 comment" than "1 comment(s)". The "One comment" and "Many comments" template parts can be used for this purpose. They will be used to fill the <%commentword%> variable that you can use elsewhere.

If there is only 1 comment, <%commentword%> will be equal to the contents of the "one comment" part. If there are many comments (more than one), <%commentword%> will be equal to the contents of the "two (or more) comments" part.

Typical values are "comment" and "comments". No special variables can be used here.

Template Items - Permalink

Templates: comments

There are three possible structures for a comments block.

  1. When comments are displayed (like on detail pages, or on the main page when there are less than the maximum allowed amount of comments)
    comments header
      comments body (repeated)
    comments footer
  2. When there are no comments at all
    no comments
    
  3. When there are comments, but there are more than the maximum allowed number. (only applies when not on a detailed item page)
    too much comments
    

Inside these template-parts, some comments-related variables are available

Template Items - Permalink

Templates: Comments Read More

This is the format of the link that will be added at the end of <%short%>, which is a variable for use in the comment body

Inside this template-part, some comments-related variables are available (except for the <%short%> variable).

Example:

 <a href="<%itemlink%>">[more]</a>

Template Items - Permalink

Template: Date headers/footers

The date header and date footer can contain date and time vars. More info on the available vars. If you want to get started quickly, use "%x" to format the date. The language which is used to format the date, is determined by the locale-setting in the template.

In the date header, the template variable <%%daylink%%> is allowed to insert a link to the archive for that day. Note the double '%'! It's necessary to avoid %d to be expanded as the current day of the month. Also, if you just want to add a '%' character somewhere, you should also put it twice ('%%') or it will be gone on your website.

Sample for date header:

<div class="day">
<h1>%d %B</h1>

Sample for date footer:

</div>

And another example for the date head using daylink

<div class="day">
<h1>%d %B</h1>
<a href="<%%daylink%%>">(archive)</a>

Template Items - Permalink

Templates: Date and Time formats

These are used to format dates and times into the <%date%> and <%time%> vars (see template vars). The formatting is done according to the locale

More info on the available vars. If want to get started quickly, use "%x" to format the date and "%X" to format the time.

Template Items - Permalink

Templates: Edit Link

This template defines how the edit-templatevar will be marked up. You can use any of the template variables here.

Example:

<a href="<%editlink%>"
   onclick="<%editpopupcode%>">edit</a>

Template Items - Permalink

Templates: Highlight

The highlighting is used when performing searches. This is actually used in a regular expression, so you might want to escape some characters by putting a backslash before them. The place where the highlighted word will come, is indicated by "\0".

Example

<span style='background-color:yellow'>\0</span>

Template Items - Permalink

Templates: Items

When items are shown, the following setup is repeated for each item:

item header
item body
item footer

These three blocks all refer to a template-part, which define what the result looks like.

Variables

Within these template, a series of so called template variables can be used to insert item data.

Example

An example

Template Items - Permalink

Templates: Items Example

An example for the item body template:

<h1><%title%></h1>

<p><%body%></p>

<div class="metadata">
 <a href="<%itemlink%>">link</a> -
 <%date%> <%time%> -
 <a href="<%authorlink%>"><%author%></a> -
 <%comments%>
</div>

The result would become something like this:

This is an item

This is the text for the item

link - August 8th 2002 18:51 - karma - no comments

Template Items - Permalink

Templates: Link to extended entry

This is the template that will be used to format the morelink templatevar that is available in the item templates. Available variables are the same as in the item templates.

When there's no extended part of the item, the <%morelink%> templatevar will have no effect.

Example

<a href="<%itemlink%>">[Read More!]</a>

Template Items - Permalink

Templates: Locale

This is actually not a template-part, it's a setting. Setting it allows the date and time preferences when to be localized. Names of months and days will be in the desired language, etc.

The possible values depend according to which machine Nucleus is running on. Some possible values are

  • en: English
  • dutch: Dutch
  • ...

More info in the Open Group Specification for strftime. (opens a new window)

The locale is used for the date and time format, for the dateheaders, and for the archivelist items

Template Items - Permalink

Templates: Media & Popups

These templates are used to format links to popup image windows and media objects (non-pictures). The available variables for each of the templates are described below

Popup Link Code

Name Description
popuplink an <a href... link ready to use
rawpopuplink only the url inside href="..."
popupcode javascript code to open window
text the alternate text (link text)
width image width
height image width
popuptext (=same as text)

Inline Image Code

Name Description
image an IMG-tag, ready to use
link direct link to the image (URL)
text the alternate text (link text)
width image width
height image width

Media Object Link Code

Name Description
media an A-tag, ready to use
link direct link to the file (URL)
text the alternate text (link text)

Template Items - Permalink

Templates: Member Extra

This is a template you can use to add an extra indication that a comment-author is a member. It ends up in the <%authtext%> variable for use in the comment body

Inside this template-part, some comments-related variables are available.

Template Items - Permalink

Template: 'New' indication

When the 'last visit' cookie option is activated, the contents of the 'Indication of new item'-template is copied into the <%new%> variable for items that have been added since the last visit. The <%new%> variable can e.g. be used in the item body-template.

When the 'last visit' cookie is disabled, or the item is not 'new', this template part will not be used.

Template Items - Permalink

Templates: nothing found

Shown when a search has been performed and no results were found.

Available variables:

Name Description
blogid ID of the weblog
query the query that was used in the search

Example

No search results found for <b><%query%></b>

Template Items - Permalink