標(biāo)簽聚合語法說明
更新時(shí)間:2019-12-10
一、默認(rèn)url
bq/標(biāo)簽名/t_#模型標(biāo)識#.html
二、標(biāo)簽聚合頁SEO信息調(diào)取
{{ Pageinfo['pageseo']['title'] }}? ? ? ? ? //標(biāo)題
{{ Pageinfo['pageseo']['keywords'] }}? ? ? //關(guān)鍵詞
{{ Pageinfo['pageseo']['description'] }}? ?//描述
{{ Pageinfo['pageseo']['url'] }}? ? ? ? ? ?//頁面URL
三、某標(biāo)簽在模型下的全部數(shù)據(jù)調(diào)取
1. 數(shù)據(jù)源獲取
Tags.getModelInfoByTags('#模型標(biāo)識#', Pageinfo['tagname'], #數(shù)字#,['addtime':-1])?//獲取單個(gè)標(biāo)簽在模型中應(yīng)用的內(nèi)容的信息
代碼說明:
#模型標(biāo)識#? ? ? ? ? ? ? ?//獲取相應(yīng)的模型
Pageinfo['tagname']? ? ?//獲取當(dāng)前的標(biāo)簽
#數(shù)字#? ? ? ? ? ? ? ? ??//每頁的數(shù)據(jù)數(shù)目
['addtime':-1]? ? ? ? ?//模型數(shù)據(jù)按照添加時(shí)間倒序排列
2.模型內(nèi)容調(diào)取
title? ? ? ? ? ? ? ? ? ?//標(biāo)題
intro? ? ? ? ? ? ? ?? ?//簡介
tagname? ? ? ? ? ? ? ?//標(biāo)簽名
['addtime'].toDateTime().format('Y-m-d H:i:s') ? ?//添加時(shí)間
四、翻頁
{{ Tags.getPageHtml(數(shù)字, listData["total"]) }}? ? ?//標(biāo)簽翻頁,并設(shè)置每頁的數(shù)量
{{System.setPageButtonCount('Tags',#數(shù)字#) }} ? ? ?//設(shè)置中間頁碼的數(shù)量
?
上下翻頁控制:(在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;}? ? ?//下一頁
四、標(biāo)簽聚合頁使用示例
<div>
{% if isset(Pageinfo['relainfo']['products']) and Pageinfo['relainfo']['products'] %}
//判斷,這個(gè)標(biāo)簽是否有產(chǎn)品在使用
{% 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>標(biāo)簽:</span>{{Pageinfo['tagname']}}
{{v['addtime'].toDateTime().format('Y-m-d H:i:s')}}
</div>
{% endfor %}
{% else %}
{% endif %}
<div>
{{System.setPageButtonCount('products',#數(shù)字#) }}
{% if listData["total"] %}
{{ Tags.getPageHtml(9, listData["total"]) }}
{% endif %}
</div>
</div>
?
?
?
?