Yunucms 模板制作标签 · 点击标签即可复制对应的标签代码
| 参数名 | 名称 | 默认 | 说明 |
|---|---|---|---|
| typeid | 类型 | 1 | 1主导航,2尾导航,3全部 |
| limit | 显示数量 | 10 |
<yunu:nav typeid="1" limit="100">
<li>
<a href="{$nav.url}" target="{$nav.target}">{$nav.title}</a>
</li>
</yunu:nav><yunu:nav typeid="1" limit="100">
<li>
<a href="{$nav.url}" target="{$nav.target}">{$nav.title}</a>
<volist name="nav['child']" id="v">
<ul>
<li><a href="{$v.url}">{$v.title}</a></li>
</ul>
</volist>
</li>
</yunu:nav><yunu:nav typeid="1" limit="100">
<li>
<a href="{$nav.url}">{$nav.title}</a>
<volist name="nav['child']" id="v">
<ul>
<li>
<a href="{$v.url}">{$v.title}</a>
<dl class="nav-sub2">
<volist name="v['child']" id="vv">
<dd><a href="{$vv.url}" class="v3">{$vv.title}</a></dd>
</volist>
</dl>
</li>
</ul>
</volist>
</li>
</yunu:nav><?php $cateparent = 0;?>
<if condition="$cid">
<yunu:catlist cid="$cid" type="parent">
<?php $cateparent = $catlist['pid'] != 0 ? $catlist['pid'] : $cateparent ;?>
</yunu:catlist>
</if>
<?php $navpid = $cateparent ? $cateparent : $cid;?>
<yunu:nav typeid='1'>
<li <eq name="$nav['id']" value="$navpid">class="on"</eq>>
<i class="arr"></i>
<a href="{$nav.url}">{$nav.title}</a>
<div class="dropdown-box">
<volist name="nav['child']" id="v">
<a href="{$v.url}">{$v.title}</a>
</volist>
</div>
</li>
</yunu:nav>| 参数名 | 名称 | 默认 | 说明 |
|---|---|---|---|
| typeid | 类型 | 1 | 1电脑,2手机,0全部 |
| orderby | 排序 | id,desc | asc正序,desc倒序 |
| limit | 显示数量 | 10 |
<yunu:banner type="1" limit="10" orderby="sort desc">
<li>
<a href="{$banner.url}"><img src="{$banner.pic}" alt="{$banner.title}"></a>
</li>
</yunu:banner><yunu:banner type="2" limit="10" orderby="sort desc">
<li>
<a href="{$banner.url}"><img src="{$banner.pic}" alt="{$banner.title}"></a>
</li>
</yunu:banner>| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| cid | 栏目ID | number | 必填 | 后台栏目ID 或者 $cid-当前栏目id |
| sname | 末尾链接名称 | string | 空 | - |
| surl | 末尾链接地址 | string | 空 | - |
| delimiter | 分隔符 | string | >> | 设置所有链接之间的间隔符 |
<span>您的当前位置:</span>
<yunu:position cid="$cid" sname="当前页面" surl="javascript:;" delimiter="-" />| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| type | 类型 | number | 1 | 1-首页 2-内页 3-其他 |
| orderby | 排序 | string | id,desc | asc-正序 desc-倒序 |
| limit | 显示数量 | number | 10 | - |
| flag | 标示 | bool | 不限制 | true-有图片 false-无图片 |
<yunu:link type="1" limit="35" orderby="sort desc" flag="1" >
<a href="{$link.url}" target="_blank">{$link.title}</a>
</yunu:link>| 参数名 | 名称 | 默认 | 说明 |
|---|---|---|---|
| cid | 栏目id | $cid为当前id | |
| type | 类型 | son | son-下级栏目 self-同级栏目 top-顶级栏目(此类型下cid可忽略) parent-当前栏目的顶级栏目 current-获取cid指定的栏目列表(v2.2.6) |
| limit | 显示数量 | 10 | |
| flag | 标示 | 1 | 0-不显示外部链接和单页 1-全部 |
<yunu:catlist cid="1,2,3" type="current">
<li>
<a href="{$catlist.url}">{$catlist.title}</a>
</li>
</yunu:catlist><yunu:catlist cid="1" type="parent" limit="100">
<li>
<a href="{$catlist.url}">{$catlist.title}</a>
<volist name="catlist['child']" id="v">
<ul>
<li><a href="{$v.url}">{$v.title}</a></li>
</ul>
</volist>
</li>
</yunu:catlist>cid="1" 代表后台指定的栏目id<yunu:catlist cid="$category['id']" type="parent" limit="20">
<h3><a href="{$catlist.url}">更多</a><span>{$catlist.title}</span></h3>
<ul>
<yunu:list cid="$catlist['id']" orderby="sort desc" limit="5">
<li><a href="{$list.url}"><span>{$list.create_time|date='Y-m-d',###}</span>{$list.title}</a></li>
</yunu:list>
</ul>
</yunu:catlist><yunu:catlist cid="$category['id']" limit="20" type="parent" orderby="sort desc">
<li <if condition="$catlist['id'] eq $cid || $catlist['id'] eq $category['pid']">class="on"</if>> <a href="{$catlist.url}" class="v1"><span>{$catlist.title}</span></a>
<if condition="$catlist.child">
<dl class="snv-index-sub1">
<volist name="catlist['child']" id="v">
<dd <if condition="$v['id'] eq $cid || $v['id'] eq $category['pid']">class="ok"</if>> <a href="{$v.url}" <if condition="$v.child">class="v2"</if>>{$v.title}</a>
<if condition="$v.child">
<dl class="snv-index-sub2">
<volist name="v['child']" id="vv">
<dd <if condition="$vv['id'] eq $cid || $vv['id'] eq $category['pid']">class="ok"</if>> <a href="{$vv.url}" class="v3">{$vv.title}</a> </dd>
</volist>
</dl>
</if>
</dd>
</volist>
</dl>
</if>
</li>
</yunu:catlist><yunu:catlist cid="$category['id']" type="parent" limit="200">
<h3 class=""><a href="{$catlist.url}">{$catlist.title}</a><em>>></em></h3>
<ul><volist name="catlist['child']" id="v"><li><a href="{$v.url}">{$v.title}</a></li></volist></ul>
<ul>
<yunu:list cid="$catlist['id']" orderby="sort desc" limit="5">
<li><a href="{$list.url}"><span>{$list.create_time|date='Y-m-d',###}</span>{$list.title}</a></li>
</yunu:list>
</ul>
</yunu:catlist>| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| cid | 栏目ID | number | 必填 | 后台非单页模型栏目ID 或者 $cid-当前栏目id |
| titlelen | titlelen | number | 0 | 0-不截取 |
| orderby | 排序 | string | id,desc | sort asc-排序正序 sort desc-排序倒序 create_time asc-创建时间正序 create_time desc-创建时间倒序 update_time asc-更新时间正序 update_time desc-更新时间倒序 click desc-点击量排序 istop desc-推荐优先排序 rand()-随机 |
| keyword | 关键词 | string | 空 | 模糊查询title(标题)字段 |
| limit | 显示数量 | number | 10 | 当设置了pagesize时,该参数无效 |
| pagesize | 分页数 | number | 0 | 配合{$page}使用,生成分页 |
| flag | 标示 | number | 0 | 1-推荐 0-全部 |
| top | 头条 | number | 0 | 0-非头条 1-一级头条 ..... 9-九级头条 |
| tag | 标签 | string | 空 | 增加list标签筛选条件,可直接输入中文,或使用"$content['tag']"使用当前详情页的 |
| sql | 分类范围 | string | 空 | 例如"131 and 132 and 133"and/or 必须配合field标签组合使用 |
| area | 指定地区 | string | 空 | 指定地区分类ID,获取该地区内容列表 |
| image | 获取带图内容 | number | 默认获取所有,1获取带图内容 | |
| pagecss | 分页样式 | string | 1 | 1-带分页样式,0-不带分页样式 |
| time | 时间 | number | 0 | 筛选一定修改时间内的内容,值填写时间戳,比如5天内值为:432000(秒*分*小时*天) |
<yunu:list cid="1" orderby="sort desc" limit="10">
<li><a href="{$list.url}" title="{$list.title}">
<div class="date">{$list.create_time|date='Y-m-d H:i:s',###}</div>
<div class="text">
<h4>{$list.title}</h4>
<p><if condition="$list['desc']">{$list.desc|str2sub=140, true}<else/>{$list.content|str2sub=140, true}</if></p>
</div>
</a> </li>
</yunu:list><yunu:list cid="$cid" titlelen="20" limit="10">
<li>
<div class="text">
<h3><yunu:type typeid="$list['cid']"><a href="{$type.url}">{$type.title}</a></yunu:type></h3>
<h4><a href="{$list.url}" title="{$list.title}">{$list.title}</a></h4>
</div>
</li>
</yunu:list><yunu:list cid="$cid" titlelen="20" limit="10">
<li>
<div class="text">
<h3><yunu:type typeid="$list['cid']"><a href="{$type.url}">{$type.title}</a></yunu:type></h3>
<h4><a href="{$list.url}" title="{$list.title}">{$list.title}</a></h4>
<p>TAG:<yunu:tag title="$list['tag']"><a href="{$tag.url}">{$tag.title}</a></yunu:tag></p>
</div>
</li>
</yunu:list><yunu:list cid="$cid" tag="$content['tag']" titlelen="20" limit="10">
<li>
<div class="text">
<h4><a href="{$list.url}" title="{$list.title}">{$list.title}</a></h4>
<p><yunu:tag title="$list['tag']"><a href="{$tag.url}">{$tag.title}</a></yunu:tag></p>
</div>
</li>
</yunu:list><yunu:list cid="$cid" pagesize="6" limit="10">
<li>
<div class="text">
<h3><yunu:type typeid="$list['cid']"><a href="{$type.url}">{$type.title}</a></yunu:type></h3>
<h4><a href="{$list.url}" title="{$list.title}">{$list.title}</a></h4>
</div>
</li>
</yunu:list>
<div class="pages">
{$page}
</div>$pagearr['var_link_rows'] = 7 修改分页数量方法:app\index\model\ContentModel.php 中搜索,把7改成需要的数字| 参数名 | 名称 | 默认 | 说明 |
|---|---|---|---|
| typeid | 栏目id | $cid为当前id | |
| type | 类型 | parent | parent-当前栏目的顶级栏目 |
<yunu:type typeid='21' type="parent">
<a href="{$type.url}">{$type.title}</a>
</yunu:type><yunu:type typeid="$parent['id']" type="self">
<a href="{$type.url}">{$type.title}</a>
</yunu:type><yunu:type typeid="$category['id']">
<div class="banner-sub" style="background-image:url({$type.pic})"></div>
</yunu:type><yunu:type typeid="$category['id']" type="parent">
<div class="banner-sub" style="background-image:url({$type.pic})"></div>
</yunu:type><volist name="$content.piclist|str2arr='***'" id="v" key="k"><if condition="$k eq 0">< img src="{$v}"></if></volist>| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| conid | 内容ID | number | 必填 | 内容ID |
| type | 类型 | string | 必填 | prev(获取上一个)/next(获取下一个) |
| orderby | 排序条件 | string | id | 排序条件 |
<yunu:info conid="$content['id']" type="prev" orderby="id">
上一篇:<a href="{$info.url}">{$info.title}</a>
</yunu:info>
<yunu:info conid="$content['id']" type="next" orderby="id">
下一篇:<a href="{$info.url}">{$info.title}</a>
</yunu:info>| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| pid | 上级id | number | 0 | 设置未指定pid时默认使用pid 0-读取所有顶级地区 |
| top | 是否推荐 | bool | false | false-全部 true-开启推荐 |
| con | 独立内容 | bool | false | false-全部 true-开启独立内容 |
| url | 二级域名 | bool | false | false-全部 true-开启二级域名 |
| limit | 显示数量 | number | 10 | - |
| type | 只读取当前地区信息 | string | group | group-梯度显示 current-当前地区 level-平级 province-获取当前城市省份 |
| conurl | 生成 | number | 0 | 0-根据当前页面自动生成URL 1-根据首页URL情况生成 |
| topzm | 头字母 | string | 空 | 根据地区首字母筛选地区列表 |
<yunu:area top="1" con="1" url="1" limit="20" type="group">
<a href="{$area.url}">{$area.title}</a>
</yunu:area>top="1" 筛选出后台设置为推荐的con="1" 筛选出后台设置为独立内容的url="1" 筛选出后台设置为二级域名的limit="20" 显示20条信息type="group" 显示当前地区及子地区<yunu:area pid="0" limit="50" conurl="1">
<dl>
<dt><a href="{$area.url}">{$area.title}</a></dt>
<dd ><yunu:area pid="$area['id']" conurl="1" limit="50"> <a href="{$area.url}">{$area.title}</a> </yunu:area></dd>
</dl>
</yunu:area><yunu:area type="current">{$area.ys_title}</yunu:area><if condition="!config('sys.sys_area')">主站<else/><yunu:area type="current">{$area.ys_title}</yunu:area></if>| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| name | 标题 | string | 必填 | 自定义块名称 |
| infolen | 内容长度 | number | 0 | 0-不截取 注意:图片或丰富类型自定义块勿使用此属性 |
| textflag | 内容类型 | bool | false | true-输出为img false-输出内容 |
<yunu:block name="文字自定义块1" infolen="100" />
<yunu:block name="丰富自定义块1" />
<yunu:block name="图片自定义块1" textflag="false" />
<img class="" src="<yunu:block name="图片自定义块2" />" alt="">| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| title | tag值 | string | 可填写单个tag值或多个使用,逗号间隔 可为空,为空获取全站tag属性 | |
| limit | 显示数量 | number | 10 | - |
| type | 类型 | number | 1 | 默认获取站内内容tag统计,为2,获取tag管理内的tag信息 |
| orderby | 排序 | string | id DESC | 获取后台tag管理时,控制排序类型,id desc最新排序,click desc点击次数排序 |
<yunu:tag title="测试标签1,测试标签2,测试标签3">
<a href="{$tag.url}"><span>{$tag.title}[{$tag.num}]</span></a>
</yunu:tag><yunu:tag type="2" limit="10000">
<a href="{$tag.url}"><span>{$tag.title}[{$tag.num}]</span></a>
</yunu:tag><title><if condition="isset($tag['seo_title'])">{$tag.seo_title}<else/><if condition="$title">{$title}-tag标签列表<else/>tag标签列表</if>-<yunu:config name="site_title"/></if></title>
<meta name="keywords" content="<if condition="strlen($tag['seo_keywords']) neq 0">{$tag.seo_keywords}<else/><yunu:config name='seo_keywords'/></if>">
<meta name="description" content="<if condition="strlen($tag['seo_description']) neq 0">{$tag.seo_description|str2sub=160, true}<else/><yunu:config name='seo_description'/></if>"><yunu:list tag="$title" cid="37" limit="24" orderby="sort asc" >
<li>
<a href="{$list.url}">
<div class="imgauto1"><img src="{$list.pic}" alt="{$list.title}"></div>
<span>{$list.title}</span>
</a>
</li>
</yunu:list>| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| fid | 表单ID | number | 空 | 对应后台的表单ID |
| orderby | 排序 | string | 无 | - |
| top | 推荐 | number | 无 | 0-不推荐 1-推荐 |
| pagesize | 分页 | number | 无 | - |
| limit | 显示数量 | number | 无 | - |
<yunu:form fid="1">
</yunu:form>fid="1" 获取后台表单ID为1的信息{$form.contents} 为前台显示留言内容标签| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| id | 自定义字段ID | number | 必填 | 模型内自定义字段ID |
| group | 分组 | string | 必填 | ID分组 例如131,132,133 |
| noset | 不限 | bool | true | true-显示"不限" false-不显示"不限" |
| active | 活动 | string | active | 选中状态的class名 |
<yunu:field id="131" group="131,132,133" noset="true" active="active">
<a href="{$field.url}" class="{$field.active}">{$field.name}</a>
</yunu:field>id="131" 自定义字段ID为131的信息group="131,132,133" ID分组为[131,132,133]noset="true" 显示"不限"链接active="active" 活动链接的class名为"active"| 参数名 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| type | 类型设置 | string | cd | 类型设置 cd(标题+长尾)/bc(词头+标题)/bcd(词头+标题+长尾) 三种模式 |
| limit | 显示数量 | number | - | - |
<yunu:cwkeywords type="bc" limit="100">
<a href="{$cwkeywords.url}">{$cwkeywords.name}</a>
</yunu:cwkeywords><yunu:cwkeywords type="cd" limit="100">
<a href="{$cwkeywords.url}">{$cwkeywords.name}</a>
</yunu:cwkeywords><yunu:cwkeywords type="bcd" limit="100">
<a href="{$cwkeywords.url}">{$cwkeywords.name}</a>
</yunu:cwkeywords><form action="<yunu:url name='search'/>" method="post">
<input type="text" name="key" placeholder="请输入查询的关键字">
<button type="submit">搜索</button>
</form>search_index.html 模板名称{$keyword} 搜索结果标签<yunu:list orderby="sort desc" keyword="$keyword">
<li>
<a href="{$list.url}" title="{$list.title}">
<div class="img-center"><img src="<if condition="$list['pic']">{$list.pic}<else/>{$list.content|str2img='1'}</if>" onerror="javascript:this.src='__PUBLIC__/images/nopic.jpg';" alt="{$list.title}"></div>
<div class="text">
<h4><span>{$list.create_time|date='Y-m-d H:i:s',###}</span>{$list.title} </h4>
<p><if condition="$list['desc']">{$list.desc|str2sub=140, true}<else/>{$list.content|str2sub=140, true}</if>...</p>
<span class="more">了解详情</span> </div>
</a>
</li>
</yunu:list>| 格式化方式 | 别名 | 说明 |
|---|---|---|
| Y | 年 | 年份的四位数表示 |
| m | 月 | 月份的数字表示(从 01 到 12) |
| d | 日 | 一个月中的第几天(从 01 到 31) |
| H | 时 | 24 小时制,带前导零(00 到 23) |
| i | 分 | 带前导零(00 到 59) |
| s | 秒 | 带前导零(00 到 59) |
<yunu:list cid="$cid">
{$list.update_time|date='Y-m-d H:i:s',###}
</yunu:list>| 格式化方式 | 说明 |
|---|---|
| D | 星期几的文本表示(用三个字母表示) |
| j | 一个月中的第几天,不带前导零(1 到 31) |
| l | ('L' 的小写形式)- 星期几的完整的文本表示 |
| N | 星期几的 ISO-8601 数字格式表示(1表示Monday[星期一],7表示Sunday[星期日]) |
| S | 一个月中的第几天的英语序数后缀(2 个字符:st、nd、rd 或 th。与 j 搭配使用) |
| w | 星期几的数字表示(0 表示 Sunday[星期日],6 表示 Saturday[星期六]) |
| z | 一年中的第几天(从 0 到 365) |
| W | 用 ISO-8601 数字格式表示一年中的星期数字(每周从 Monday[星期一]开始) |
| F | 月份的完整的文本表示(January[一月份] 到 December[十二月份]) |
| M | 月份的短文本表示(用三个字母表示) |
| n | 月份的数字表示,不带前导零(1 到 12) |
| t | 给定月份中包含的天数 |
| L | 是否是闰年(如果是闰年则为 1,否则为 0) |
| o | ISO-8601 标准下的年份数字 |
| y | 年份的两位数表示 |
| a | 小写形式表示:am 或 pm |
| A | 大写形式表示:AM 或 PM |
| B | Swatch Internet Time(000 到 999) |
| g | 12 小时制,不带前导零(1 到 12) |
| G | 24 小时制,不带前导零(0 到 23) |
| h | 12 小时制,带前导零(01 到 12) |
| u | 微秒(PHP 5.2.2 中新增的) |
| e | 时区标识符(例如:UTC、GMT、Atlantic/Azores) |
| I | (i 的大写形式)- 日期是否是在夏令时(如果是夏令时则为 1,否则为 0) |
| O | 格林威治时间(GMT)的差值,单位是小时(实例:+0100) |
| P | 格林威治时间(GMT)的差值,单位是 hours:minutes(PHP 5.1.3 中新增的) |
| T | 时区的简写(实例:EST、MDT) |
| Z | 以秒为单位的时区偏移量。UTC 以西时区的偏移量为负数(-43200 到 50400) |
| c | ISO-8601 标准的日期(例如 2013-05-05T16:34:42+00:00) |
| r | RFC 2822 格式的日期(例如 Fri, 12 Apr 2013 12:01:05 +0200) |
| U | 自 Unix 纪元(January 1 1970 00:00:00 GMT)以来经过的秒数 |
| 参数位置 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| 1 | 长度 | number | 必填 | 截取字符长度 |
| 2 | 显示符号 | bool | false | true-显示 false-不显示 |
| 3 | 过滤HTML | bool | true | true-过滤HTML后按照长度进行截取 false-不过滤 |
| 4 | 符号 | string | ... | 超出部分显示为此符号 |
<yunu:list cid="$cid">
{$list.desc|str2sub=20, true}
</yunu:list>{$list.desc|str2sub=20, true} 将desc截取20个字符,多余部分显示为省略号| 参数位置 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| 1 | 分隔符 | string | 必填 | 使用此参数值对字符串进行分割 |
<volist name="$content.piclist|str2arr='***'" id="v">
{$v}
</volist>$content.mulimg|str2arr='***' 使用***作为分隔符分割$content.mulimg字符串成数组 !注意分隔符不能为竖线(|)| 参数位置 | 别名 | 类型 | 默认值 | 说明 |
|---|---|---|---|---|
| 1 | 图片序号 | number | 1 | 数字几就获取第几张图片 |
{$content.content|str2img='3'}<yunu:catlist cid="21">
<li><a href="{$catlist.url}"><span>{$catlist.title}{$catlist.id|connum}</span></a></li>
</yunu:catlist>{$catlist.id|connum} 统计这个栏目id下的内容条数template > default > index PC模板路径template > default > wap WAP模板路径default
┗━index ····························· 模板目录
┣━index_index.html ············· 首页模板
┣━public_header.html ··········· 头部通用模板
┣━public_footer.html ··········· 底部通用模板
┣━cover_product.html ··········· 产品封面模板
┣━cover_article.html ··········· 文章封面模板
┣━list_product.html ············ 产品列表模板
┣━list_article.html ············ 文章列表模板
┣━list_case.html ··············· 案例列表模板
┣━list_pic.html ················ 图片列表模板
┣━show_product.html ············ 产品详情模板
┣━show_article.html ············ 文章详情模板
┣━show_case.html ··············· 案例详情模板
┣━show_pic.html ················ 图片详情模板
┣━search_index.html ············ 搜索模板
┣━tag_index.html ··············· TAG模板
┣━list_message.html ············ 留言模板
┗━list_map.html ················ 城市分站地图模板