admin管理员组文章数量:1566222
2024年7月17日发(作者:)
头部统一设置:
分类:
<@_category id=id>
<#assign category=object/>
<#assign attribute=getCategoryAttribute(id)/>
@_category>
内容:
<@_content id=id>
<#assign content=object/>()
<#assign attribute=getContentAttribute(id)/>
@_content>
a>${a}<#sep>,#list>">
as
Banner的动态导入:
例子:
添加元数据
利用模板帮助--------->扩展字段可以取出字段
页面的页面管理可以给元数据赋值:
当前位置
测试接口
localhost:8082/
1.模板创建 分类创建 :
/introduction/2017/03-25/
2.网站创建: /introduction/2017/03-25/
静态变动态
(1) 文件路径的修改: ${th}
(2) Logo的添加: logo使用的地方很多,所以保存为站点配置
(3) 带文章的分类
动态加载导航:
动态加载内容:
添加子分类重用模板:(cms的添加子分类有bug,需要手动添加)
修改url链接
<#if ds?has_content>
<@_categoryList parentId=>
<#list as a>
#list>
@_categoryList>
<#else>
<@_category id=Id>
@_category>
<@_categoryList parentId=Id typeId=typeId
allowContribute=allowContribute pageIndex=pageIndex count=count>
<#list as a>
#list>
@_categoryList>
#if>
(4) 公共区块(头部导航,尾部联系我们等): 18min ------------页面片段(静态)
(5) 新闻: 35min
上传模板,修改代码,title使用比较好,可以在seo修改.
<@_category id=id>
<#assign category=object/>
<#-- 分类扩展数据(参数为分类ID) -->
<#assign attribute=getCategoryAttribute(id)/>
@_category>
加入分类,注意路径:
使用内容指令,修改参数:
<#-- categoryId:分类ID,containChild:包含子分类内容,modelId:模型ID,parentId:
父内容ID,onlyUrl:["true":仅外链,"false":非外链,默认全部],hasImages:["true":仅图
集,"false":非图集,默认全部],hasFiles:["true":仅带附件,"false":非带附件,默认全
部],orderField:排序字段["scores":分数,"comments":评论,"clicks":点击,"publishDate":
发布日期,默认排序+发布日期倒序],orderType:排序类型["asc":正序,"desc":倒
序],pageIndex:页码,count:每页数据条数 -->
<@_contentList categoryId=id containChild=containChild modelId=modelId
parentId=parentId onlyUrl=onlyUrl hasImages=hasImages hasFiles=hasFiles
orderField=orderField
count=ze>
orderType=orderType pageIndex=pageIndex
<@_contentList categoryId= containChild=true
pageIndex=pageIndex count=ze>
<#list as a>
l>${cPath}content/?id=${}<#else>${!}#if>" target="_blank">${}
<#if ?has_content>
alt="${}"/>#if>
${ption!}
#list>
<#if !age>
<#else>
上一页
#if>
<#assign start=1/>
<#if (dex-5) gt start>
<#assign start=dex-4/>
#if>
<#assign end=age/>
<#if (dex+5) lt end>
<#assign end=dex+4/>
#if>
<#if start gt 1>
1 ...
#if>
<#d as n>
<#if n=dex>
${n}
<#else>
#if>
#list>
<#if end lt age>
... href="?id=${id}&pageIndex=${age}">${age}
#if>
<#if !ge>
<#else>
下一页
#if>
<@_contentList>
在分类添加模型:
内容发布:
内容详情页面:
取出内容的正文:
取出内容的图片: <#if ges>
<@_contentFileList contentId= image=true count=2>
<#list as i>
" alt="${}"/>
#list>
@_contentFileList>
#if>
父分类遍历子分类内容
<@_categoryList parentId=>
<#list as x>
<@_contentList categoryId=>
<#list as a>
l>${cPath}content/?id=${}<#else>${!}#if>" target="_blank">${}
<#if ?has_content>
src="${th+}" alt="${}"/>#if>
${ption!}
#list>
@_contentList>
#list>
@_categoryList>
<@_contentList categoryId=4 containChild=true><#list as a>
<#-- 内容扩展数据(参数为内容Id) -->
<#assign attribute=getContentAttribute()/>
href="${!}">${}${ption}${(?no_esc)!}
ath+}#list>
@_contentList>
<#-- categoryId:分类ID,containChild:包含子分类内容,modelId:模型ID,parentId:
父内容ID,onlyUrl:["true":仅外链,"false":非外链,默认全部],hasImages:["true":仅图
集,"false":非图集,默认全部],hasFiles:["true":仅带附件,"false":非带附件,默认全
部],orderField:排序字段["scores":分数,"comments":评论,"clicks":点击,"publishDate":
发布日期,默认排序+发布日期倒序],orderType:排序类型["asc":正序,"desc":倒
序],pageIndex:页码,count:每页数据条数 -->
<@_contentList categoryId=4 containChild=true>
<#list as a>
<#assign attribute=getContentAttribute()/>
href="${!}">${}${ption}${(?no_esc)!}
ath+}
<#-- orderField:排序字段["size":大小,"click":点击,默认排序字段顺序],orderType:排
序类型["asc":正序,"desc":倒序],pageIndex:页码,count:每页数据条数 -->
#list>
@_contentList>
<@_content ids=[7,9]><#list map?keys as k> href="${map[k].url!}">${map[k].title}
版权声明:本文标题:public cms使用 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1721202608a865703.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论