Chapter 2: Use of Template Tags

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

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

phpStudy安装鲶鱼CMS怎样开启伪静态

phpStudy是一款PHP运行环境的集成包,为了方便,我们在调试或者运行PHP程序的时...

Refuting the article "Not...

Today, users of Catfish CMS told me that the...

使用mysql命令解决phpMyAdmin在MySQL8下面无法登录...

MySQL是一款优秀的数据库系统,有大量的应用会使用MySQL,截止本文发布,MySQL...

如何给导航菜单添加图标

我们访问某些网站的时候,会发现导航菜单的文字前面有一个小图标,如下图所示: 在鲶鱼系统...

bootstrap4导航菜单的二级下拉菜单鼠标悬停显示jQuery怎...

bootstrap的导航菜单默认都是通过鼠标点击来展开的,有时我们为了让浏览者有更好的访...

jQuery如何获取当前元素的ID

jQuery是一个优秀的JavaScript库,给前端页面的制作带来了极大的方便,鲶鱼系...

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

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