The template items that make up a Nucleus template.
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.
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 |
<ul> <li><a href="<blogurl%>">All</a></li>
<li><a href="<%catlink%>"><%catname%></a></li>
</ul>
This is the part of the template used to display a single comment. In this template-part, comments-related templatevars are available.
<h2>Comment by <%userlink%>:</h2> <p><%body%></p> <div class="metadata"> (from <%host%> on <%date%> at <%time%>) </div>
Result:
Nice!
(from host.example.org on 2003-03-02 at 13:30)
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
Header:
<ul>
Body:
<li><%user%>: <%body%></li>
Footer
</ul>
Result
There are three possible structures for a comments block.
comments header comments body (repeated) comments footer
no comments
too much comments
Inside these template-parts, some comments-related variables are available
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).
<a href="<%itemlink%>">[more]</a>
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.
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: <code> <div class="day"> <h1>%d %B</h1> </code> Sample for date footer: <code> </div> </code> And another example for the date head using daylink <code> <div class="day"> <h1>%d %B</h1> <a href="<daylink%%>“>(archive)</a> </code>
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.
This template defines how the edit-templatevar will be marked up. You can use any of the template variables here.
<a href="<%editlink%>" onclick="<%editpopupcode%>">edit</a>
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”.
<span style='background-color:yellow'>\0</span>
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.
Within these template, a series of so called template variables can be used to insert item data.
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 the text for the item
link - August 8th 2002 18:51 - karma - no comments
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.
<a href="<%itemlink%>">[Read More!]</a>
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
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
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
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) |
link | direct link to the image (URL) |
media | a non-popup A-tag to the image, ready to use |
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 | an A-tag to the image, ready to use |
Name | Description |
---|---|
media | an A-tag, ready to use |
link | direct link to the file (URL) |
text | the alternate text (link text) |
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.
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.
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 |
No search results found for <b><%query%></b>