Chapter 2: Use of Template Tags

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

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

{/volist}


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

{/notempty}


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

{/empty}


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

{/if}


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

touxiang:Avatar

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

biaoti:title

suolvetu:thumbnail

zhaiyao:summary

laiyuan:source

fabushijian:release time

nicheng:nickname

yuedu:reading volume

zhengwen:text

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

Reward

I want to comment Sign in to post a comment

User comments


leoyone

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

学习了。


Latest release

鲶鱼CMS和鲶鱼Blog自制注册页面的代码实现

我们在《鲶鱼CMS和鲶鱼Blog怎么自定义注册页面》一文里面介绍了如何通过制作主题文件来...

鲶鱼cms系统和鲶鱼blog系统怎么填写公安备案号和ICP备案号

在实际建站过程中,往往需要进行网站备案,那么当我们备案之后,需要按要求在自己网站上放上备...

关于鲶鱼Blog系统2.3.21版以后版本升级的说明

鲶鱼Blog系统可以在后台上传升级包进行升级,有些用户可能会很长时间没有升级,这样可能会...

鲶鱼CMS和鲶鱼Blog自制登录页面代码怎么实现

我们在《鲶鱼CMS和鲶鱼Blog怎么自定义登录页面》一文里面介绍了怎么在制作主题的时候自...

鲶鱼CMS和鲶鱼Blog怎么自定义注册页面

我们在《 鲶鱼CMS和鲶鱼Blog怎么自定义登录页面》这一篇里面介绍了如何自己制作一个登...

鲶鱼CMS和鲶鱼Blog怎么自定义登录页面

我们在使用鲶鱼cms和鲶鱼blog时,有的时候希望根据自己的需求设计登录页面,该怎么办?...

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 - 2020 Catfish(鲶鱼) CMS
Catfish(鲶鱼) CMS〖181836340〗 Catfish(鲶鱼) CMS 二群〖292598750〗

   I want to leave a message
Catfish(鲶鱼) CMS V 4.9.90