Chapter 2: Use of Template Tags

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

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主题里面怎么实现“头条”

我们在《鲶鱼cms系统如何把文章设置为“头条”》这一篇里面介绍了怎么使用“头条”,这一篇...

鲶鱼cms系统如何把文章设置为“头条”

鲶鱼cms可以满足不同的企事业单位的建站需求,如果您是某个新闻媒体企业的话,那么在播报新...

为抗击新型冠状病毒感染肺炎疫情出一份力的通知

据国家卫健委报告,新型冠状病毒感染肺炎确诊人数的日增加数量已经从前几日的每天几十人突然加...

鲶鱼cms怎么设置主页面

在企业站的应用里面,经常会把某个活动页面作为主页面在首页展示的情况,这一篇我们来介绍一下...

关于赞助款使用情况的通报

自2019年7月31日起,至2020年1月28日止,累计收到赞助款120元8角8分,目前...

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.69