15621857753

2020最新版phpcms V9标签模板用法大全

来源:齐鲁建站 栏目:开发教程 阅读: 日期:2020-11-26

2020最新版phpcms V9标签模板用法大全,常见获取栏目名称和获取上级栏目名称 当前栏目id: {$catid} 当前栏目名: {$CATEGORYS[$catid][catname]} 当前栏目目录名: {$CATEGORYS[$catid][catdir]} 当前栏目url: {$CATEGORYS[$catid][url]} 当前栏目描述:{$CATEGORYS[$catid][description]}

常见获取栏目名称和获取上级栏目名称 

当前栏目id: {$catid} 

当前栏目名: {$CATEGORYS[$catid][catname]} 

当前栏目目录名: {$CATEGORYS[$catid][catdir]} 

当前栏目url: {$CATEGORYS[$catid][url]} 

当前栏目描述:{$CATEGORYS[$catid][description]} 

当前栏目图片:{$CATEGORYS[$catid][image]}"

当前栏目的内容数: {$CATEGORYS[$catid][items]}

当前栏目的点击数: {$CATEGORYS[$catid][hits]}

当前栏目的上级栏目id: {$CATEGORYS[$catid][parentid]}

父级栏目id: $CAT[parentid];

父级栏目的所有子栏目id $CATEGORYS[$CAT[catid]][arrchildid];

其他字段:只需要改动XXX:{$CATEGORYS[$top_parentid][XXX]}

获取一级栏目名称: {$CATEGORYS[$top_parentid][catname]}

获取一级栏目url:{$CATEGORYS[$top_parentid][url]}

{template "content","header"} 一般把公用头部文件单独建立一个header.html

调用模板目录 phpcms\template\content\header文件

网站建设

{template "content","footer"} 一般把公用头部文件单独建立一个footer.html

调用模板目录 phpcms\template\content\footer文件

网站字符集的设置 一般国际通用的UTF-8 国内使用的GBK 根据需求选择字符编码

{CHARSET}

字符集 (gbk或者utf-8)

网站标题调用

{if isset($SEO['title']) && !empty($SEO['title'])}

{$SEO['site_title']}

{$SEO['keyword']}

{$SEO['description']}

{str_cut(strip_tags($r['title']),610,'…')} 过滤输出里面的html标签。然后截取字符串

{strip_tags($r['title'])} 过滤html标签

{pc:content action="position" posid="9" order="id" num="10" cache="3600"}

{pc:content action="lists" catid="10" num="15" thumb="1" order="updatetime DESC" where="catid=10" moreinfo="1"}

{pc:content action="lists" catid="9" where="catid=9 or catid=10 or catid=11 or catid=12" num="5" order="rand()"}

action="position" 获取推荐位数据

action="hits" 用于点击排行,热点

action="lists" 用于列表

action="category" 获取子栏目数据

{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}

action="relation" 获取相关数据

phpcms标签使用

{pc:content action="relation" relation="$relation" catid="$catid" num="5" keywords="$rs[keywords]"}

pc标签{pc:content 参数名="参数值"参数名="参数值"参数名="参数值"}

action="position"--------------对话框的类型='内容推荐位列表'

posid="9" -------推荐位ID="9"

order="id" -----排序类型="id"

num="10" -----数据调用数量="10"

cache="3600"-------缓存="3600"毫秒

thumb="1" 获取缩略图

moreinfo="1" 关联副本,获取副表数据,比如 文章阅读次数,文章来源等

order="rand() 随机获取指定数据

order="updatetime DESC" 按照更新时间升序 也可以updatetime ASC 或者catid DESC/ASC

{if $num%5==0} {/if} 判断键值是5的状态(加样式或者其他作用)

{date('Y-m-d H:i:s',$r[inputtime])}输出时间格式是2018-11-16 11:20:20

或者不需要时分秒{date('Y-m-d',$r[inputtime])}去掉his也可以修改中间的-修改为/那么时间格式就是2018/11/16看项目需求

分页标签------{$pages}

文章页标签

标题-------{$title}

内容-------{$content}

日期-------{$inputtime}

来源-------{$copyfrom}

调用文字友情链接

{pc:link action="type_list" siteid="$siteid" order="listorder DESC" num="10" return="dat"}

{loop $dat $v}

{$v[name]} |

{/loop}

{/pc}

调用图片友情链接

{pc:link action="type_list" siteid="$siteid" linktype="1" order="listorder DESC" num="8"

return="pic_link"}

{loop $pic_link $v}

{/loop}

{/pc}

以上就是关于phpcms标签模板的所有内容,希望可以帮到大家,欢迎找小编一起交流~

展开