<tpl:SysIf>

Tests the specified system parameters before displaying its content.

Attributes

categories

Checks if the categories are defined in the current context (value = 1) or not (value = 0).

posts

Checks if the posts are defined in the current context (value = 1) or not (value = 0).

blog_lang

Checks if the blog language code is the same as the one given in this parameter. The language is encoded on two characters, following the ISO-369-1 norm. If the value starts with "!", checks if the blog language is different from the given value.

blog_id

Checks if the blog identifier is the same as the one given in this parameter.

current_tpl

Checks if currently used template filename is the same as the one given in this parameter. If the value starts with "!", checks if the template filename is different from the given value.

The following example can be inserted in the _head.html file. It displays a JavaScript message box "Enjoy the reading!" before displaying the page if the post.html file is used:

<tpl:SysIf current_tpl="post.html">
<script type="text/javascript">
//<![CDATA[
alert('Enjoy the reading!');
//]]>
</script>
</tpl:SysIf>

current_mode

Checks if the URL type is the same as the one given in this parameter. To get the opposite result, simply add "!" in front of the given value.

has_tpl

Checks if the specified template file exists. To get the opposite result, simply add "!" in front of the given value.

has_tag

Checks if the specified tag exists. To get the opposite result, simply add "!" in front of the given value.

comments_active

Checks if the comments are open (value = 1) or closed (value = 0) on the blog.

pings_active

Checks if trackbacks are open (value = 1) or closed (value = 0) on the blog.

wiki_comments

Checks if the Wiki syntax is authorized in comments (value = 1) or not (value = 0).

search_count

Checks the number of posts found by the search function. The expression looks like "<operator> <number>" where <number> is a chosen reference number and <operator> one of the following values:

  • ==: checks that the number of posts found is equal to the reference number
  • !=: checks that the number of posts found is different from the reference number
  • &gt;=: checks that the number of posts found is greater than or equal to the reference number
  • &lt;=: checks that the number of posts found is less than or equal to the reference number
  • &gt;: checks that the number of posts found is greater than the reference number
  • &lt;: checks that the number of posts found is less than the reference number

This parameters only has sense in the search.html file.

Contexts, modes and template files

Here are the modes used by Dotclear:

Context Mode Template file
Error 404 404 404.html
Homepage default home.html
Next pages (when navigating from homepage) default-page home.html
Search search search.html
Category category category.html
Archives archive archive.html
Monthly archives archive archive_month.html
Password protected post default password-form.html (a form asking the password to access this post)
Post without a password post post.html
Preview post preview post.html
Page page page.html
Tag tag tag.html
Tags tags tags.html
Feed feed Files rss2.xml, rss2-comments.xml, atom.xml and atom-comments.xml

The mode is used with the current_mode argument and the template file is used with the current_tpl argument.

The following tags will have the same behavior:

<tpl:SysIf current_mode="404">
Erreur 404
</tpl:SysIf>
<tpl:SysIf current_tpl="404.html">
Erreur 404
</tpl:SysIf>

Wiki powered by Dokuwiki.