Chapter 2: Use of Template Tags

Release time:2017年12月19日 Author:Catfish CMS Reading volume:126961

Previously we learned  about the topic of the file structure, this one we will learn in the  production of the theme to use some of the simple template label use. Once you've learned the template tags, you can really start building your own themes. There is no little excitement^_^

Template tags start and end with {and}, for example

{$title} is the name of the site

{$subtitle} is the subtitle of the site

{$keyword} is the site key

{$description} is the site description

"$" Followed by the name of the label, label {$ title} name is "title". Similarly, the name of the tag {$ subtitle} is "subtitle".

Tag syntax

Know the label, we also need to learn a little simple tag syntax. The main grammar there

一、Circular Output Tag

{volist name="Tag-name" id="vo" offset="0" length='6'}
Output content


Description: The  name of the id can be changed, not necessarily "vo", offset said where  to start showing, length that shows the contents of several output. The example above shows that the first output from the beginning, a total of six output.

二、To determine whether the label exists

{notempty name="Tag-name"}
If the label is not empty, the content is displayed


Description: If the label is not empty, then the contents of the label between the display.

{empty name="Tag-name"}

If the label is empty, the content is displayed


Note: If the label contents are empty, the contents of the label are displayed.

三、Judgment label

{if condition="$Tag-name eq 1"}

Output 1

{else /}

Output 2


Description: If the label is equal to 1, it will output 1, otherwise it will output 2. "Eq" means equal to, "neq" means not equal.

The theme of the label syntax is applied to the above three, with the system agreed label name, you can develop the theme.

The following list of agreed label names is provided for easy reference

title:The name of the site

subtitle:The subtitle of the site

keyword:Site Keyword

description:Site description

domain:The domain name of your site

template:The currently used template


login:log on user;

yunxupinglun:Allow comments

hunhe.hunhe1.neirong:The contents of the first mixed item in the mixed group

The second mixed item is:hunhe.hunhe2.neirong,And so on, until hunhe.hunhe6.neirong

tuwen.tuwen1.neirong:The contents of the first graphic item in the graphic group

The second graphic item is:tuwen.tuwen2.neirong,And so on, until tuwen.tuwen3.neirong

Mixed items, and labels in the graphic contents





fabushijian:release time


yuedu:reading volume


zan:point praise number

For ease of use, here are the use of Pinyin.

In addition, the  {$ neirong.biaoti | subtext = 28} tag represents the title in the  output and captures the length of 28 characters, automatically adding  "..." if the length is exceeded.

The important thing to note is that the function tag {$catfish} is the most important tag in the 'Catfish CMS' and 'Catfish Blog' systems. Each subject must have a tag. Without this tag, the system may run into a problem, At the same time this label is another SEO optimization label. This tag is usually placed in the "footer.html" theme file, if your theme is the simplest three files, you need to put this label in the "index.html" theme file. In the Catfish CMS and Catfish Blog systems, this tag is used only as a feature tag, and does not display anything on the front page, so you can put the {$catfish} tag in the "footer.html" Anywhere in the file.

Smart friends,  the main label is used, you can look at the system comes with the theme  of the document, the control of learning about it is easy to grasp.

Well, this one of the learning has ended, the next one we will learn how the theme file contains another theme file.

Go to the next article

Original article, reproduced please specify:Chapter 2: Use of Template Tags | Catfish(鲶鱼) CMS


I want to comment Sign in to post a comment

User comments


Comment time:2017-11-22 10:22:06


Latest release













How to use the Catfish CMS system

Section 1: How to add articles

Management background is composed of five bl...

Section 2: to the article to add c...

In the previous section, we talked about how...

Section 3: Add a menu to your site

In the previous section we talked about how ...

Section 4: Page Setup

To the last section we have learned to use t...

Section 5: Change website name, LO...

By the end of the previous section, we have ...

Copyright © 2015 - 2022 Catfish(鲶鱼) CMS
Catfish(鲶鱼) CMS〖181836340〗 一群已满,请加二群:Catfish(鲶鱼) CMS 二群〖292598750〗

   I want to leave a message