企业微信服务商
当前位置:首页文档模板语法标签聚合语法说明

标签聚合语法说明

更新时间:2019-12-10

一、默认url

bq/标签名/t_#模型标识#.html

二、标签聚合页SEO信息调取

{{ Pageinfo['pageseo']['title'] }}          //标题
{{ Pageinfo['pageseo']['keywords'] }}      //关键词
{{ Pageinfo['pageseo']['description'] }}   //描述
{{ Pageinfo['pageseo']['url'] }}           //页面URL

三、某标签在模型下的全部数据调取

1. 数据源获取
Tags.getModelInfoByTags('#模型标识#', Pageinfo['tagname'], #数字#,['addtime':-1]) //获取单个标签在模型中应用的内容的信息
代码说明:
#模型标识#               //获取相应的模型
Pageinfo['tagname']     //获取当前的标签
#数字#                  //每页的数据数目
['addtime':-1]         //模型数据按照添加时间倒序排列
2.模型内容调取
title                   //标题
intro                  //简介
tagname               //标签名
['addtime'].toDateTime().format('Y-m-d H:i:s')    //添加时间

四、翻页

{{ Tags.getPageHtml(数字, listData["total"]) }}     //标签翻页,并设置每页的数量
{{System.setPageButtonCount('Tags',#数字#) }}      //设置中间页码的数量
 
上下翻页控制:(在css文件中编写样式)
样式为空:
.u-paging .prev{display:none;}    //上一页为空
.u-paging .next{dispaly:none;}    //下一页为空
样式不为空:
.u-paging .prev{background: #eaeaea url("../images/jt.png") no-repeat center center;}         //上一页
.u-paging .next{background: #eaeaea url("../images/jt_r.png") no-repeat center center;}     //下一页

四、标签聚合页使用示例

<div>
{% if isset(Pageinfo['relainfo']['products']) and Pageinfo['relainfo']['products'] %}
//判断,这个标签是否有产品在使用
{% set listData = Tags.getModelInfoByTags('products', Pageinfo['tagname'], 9) %}
{% for k, v in listData['data'] %}
<div >
<a href="{{ v['linkurl'] }}" target="_blank">{{ v['title'] }}</a>
{{ v['intro'] }}
<span>标签:</span>{{Pageinfo['tagname']}}
{{v['addtime'].toDateTime().format('Y-m-d H:i:s')}}
</div>
{% endfor %}
{% else %}
{% endif %}
<div>
{{System.setPageButtonCount('products',#数字#) }}
{% if listData["total"] %}
{{ Tags.getPageHtml(9, listData["total"]) }}
{% endif %}
</div>
</div>