【最全最详细】publiccms其他常用代码片段(内容、站点)
生活随笔
收集整理的這篇文章主要介紹了
【最全最详细】publiccms其他常用代码片段(内容、站点)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
大家好,我是雄雄,歡迎關(guān)注微信公眾號(hào):👉雄雄的小課堂👈。
?往期系列
這兩天一直在整理Publiccms系列的教程,有需要的小伙伴們可以點(diǎn)擊以下鏈接查看:
👩?💻內(nèi)容
說(shuō)明:
- 如果此頁(yè)面需要接收參數(shù)的話,一定要在元數(shù)據(jù)的頁(yè)面加上需要接收的參數(shù) 。(此處我寫(xiě)的兩個(gè) ,分別為id和pageSize)
- 判斷父分類是否為空:
- 獲取內(nèi)容標(biāo)題:a.title
- 發(fā)表用戶:userId
- 分類編號(hào):categoryId
- 父內(nèi)容編號(hào):parentId
- 作者:author
- 是否擁有圖片列表:hasImages
- 是否擁有附件列表:hasFiles
- 地址:url
- 描述:description
- 封面:cover
- 子內(nèi)容數(shù):childs
- 發(fā)表日期:publishDate
- 創(chuàng)建日期:createDate
- 狀態(tài):status,0:草稿 1:已發(fā)布 2:待審核
內(nèi)容遍歷的時(shí)候, list里面可加的參數(shù)以及說(shuō)明:
代碼示例:
<@_contentList categoryId=categoryId containChild=containChild modelId=modelId parentId=parentId onlyUrl=onlyUrl hasImages=hasImages hasFiles=hasFiles hasCover=hasCover orderField=orderField orderType=orderType pageIndex=pageIndex pageSize=pageSize><#list page.list as a><a href="${a.url!}">${a.title}</a></#list> </@_contentList>參數(shù)說(shuō)明:
- categoryId:分類ID
- containChild:包含子分類內(nèi)容
- categoryIds:多個(gè)分類ID
- modelId:模型ID
- parentId:父內(nèi)容ID
- onlyUrl:外鏈["true":是,"false":否]
- hasImages:擁有圖片列表["true":是,"false":否]
- hasFiles:擁有附件列表["true":是,"false":否]
- hasCover:擁有封面圖["true":是,"false":否]
- orderField:排序字段["scores":分?jǐn)?shù),"comments":評(píng)論,"clicks":點(diǎn)擊數(shù),"publishDate":發(fā)布日期,"checkDate":審核日期,"updateDate":更新日期,默認(rèn):排序、發(fā)布日期字段倒序]
- orderType:排序類型["asc":正序,"desc":倒序]
- pageIndex:頁(yè)碼
- pageSize:每頁(yè)數(shù)據(jù)條數(shù)
👩?💻站點(diǎn)配置
靜態(tài)資源文件引入:
其他站點(diǎn)管管配置:
- 站點(diǎn)名稱:${site.name!}
- 站點(diǎn)LOGO:${siteAttribute.logo!}
- 站點(diǎn)方形LOGO:${siteAttribute.square_logo!}
- 打印數(shù)據(jù)模型變量:<#list .dataModel?keys as k>${k}<#sep>,</#list>
- 打印當(dāng)前命名空間數(shù)據(jù)模型:<#list .namespace?keys as k>${k}<#sep>,</#list>
3.遍歷多個(gè)標(biāo)簽
<@_tag ids=ids><#list map as k,tag>${tag.name}<#sep>,</#list> </@_tag>4.搜索頁(yè)面:
<@_search word=word tagId=tagId highlight=true dictionaryValues=dictionaryValues categoryId=categoryId containChild=containChild categoryIds=categoryIds modelIds=modelIds startPublishDate=startPublishDate pageIndex=pageIndex pageSize=pageSize><#list page.list as a><a href="${a.url!}">${a.title?no_esc}</a></#list> </@_search>參數(shù)說(shuō)明:
- word:搜索詞
- tagId:標(biāo)簽ID
- dictionaryValues:非全文搜索類型擴(kuò)展字段(值:[字段編碼]_[字段值])
- categoryId:分類ID
- containChild:包含子分類內(nèi)容
- categoryIds:多個(gè)分類ID
- modelIds:多個(gè)模型ID
- startPublishDate:開(kāi)始日期
- orderField:排序字段["publishDate":發(fā)布日期逆序]
- pageIndex:頁(yè)碼
- pageSize:每頁(yè)數(shù)據(jù)條數(shù)
categoryIds:多個(gè)分類ID
- modelIds:多個(gè)模型ID
- startPublishDate:開(kāi)始日期
- orderField:排序字段["publishDate":發(fā)布日期逆序]
- pageIndex:頁(yè)碼
- pageSize:每頁(yè)數(shù)據(jù)條數(shù)
📌今天的分享就到這里了啦,歡迎一鍵三連~關(guān)注微信公眾號(hào):雄雄的小課堂。
總結(jié)
以上是生活随笔為你收集整理的【最全最详细】publiccms其他常用代码片段(内容、站点)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: UG电脑编程需要什么电脑配置?
- 下一篇: 笑脸喜迎新同学,热情送给新伙伴