Z-BlogPHP主题教程(七)zblogphp分类/分页标签

作者:晓白pos网 发布时间:2020-10-31 04:12:11

分类标签

在摘要或文章等子模板页面中调用需在标签前加“article.”,如分类ID为:{$article.Category.ID}

标签 含义 备注
{$category.ID} 分类ID
{$category.Name} 分类名称
{$category.Alias} 分类别名
{$category.Url} 分类链接
{$category.Count} 分类文章数量
{$category.Intro} 分类摘要
{$category.Order} 分类序号
{$category.Level} 分类层级 目前支持4层级,0表示顶级,1表示2级,2表示3级,3表示4级
{$category.RootID} 分类的顶级ID 顶级ID为0时表示该分类即为一级分类
{$category.ParentID} 分类的上一级ID 同上
{$category.Parent} 分类的上一级类实例 注意:如为顶级分类则其上级类为NULL,在使用前需进行判断。如:

{if $article.Category.Parent}{$article.Category.Parent.Name}{/if}

{$category.SubCategorys} 子分类实例数组 注意:如无子分类则为空,在使用前需进行判断。
{$category.Template} 分类所用模板 默认为index
{$category.LogTemplate} 分类下文章所用模板 默认为single
{$category.Meta} 分类扩展数据(php序列化字符串) 更多请参考扩展标签

单独获取分类的信息,例如某分类ID的姓名:{$categorys[分类ID].Name}(缺点:当分类id不存在时,会导致网站页面错误,在使用前需进行判断。)

分页标签

文章列表相关页面中可用分页标签,如首页等。

标签 含义 备注
{$pagebar.PageBarCount} 分页长度
{$pagebar.PageCount} 每页显示文章数量
{$pagebar.Name} 分页名称
{$pagebar.PageAll} 总页码数
{$pagebar.PageNow} 当前页码
{$pagebar.PageFirst} 起始页码
{$pagebar.PageLast} 尾页页码
{$pagebar.PagePrevious} 上一页ID
{$pagebar.PageNext} 下一页ID
{$pagebar.prevbutton} 上一页Url <a href=“{$pagebar.prevbutton}”>« 更早的文章</a>
{$pagebar.nextbutton} 下一页Url <a href=“{$pagebar.nextbutton}”>之后的文章 »</a>
{$pagebar.buttons} 页码关联数组 键名为页码,键值为页码对应的链接。

其中有4个特殊键名‹‹ 、‹、›、››分别代表第一页、上一页、下一页、最后页。

如{$pagebar.buttons[3]}为第3页链接,{$pagebar.buttons[‘››’]}为最后一页链接。

注意:‹、›只有当上下页存在时不为空,使用时应注意判别。

文章标签(含独立页面)

Z-BlogPHP主题教程(七)zblogphp分类/分页标签

标签:, , , , ,

联系邮箱:ert5tyx@163.com(三个工作日内处理)
Copyright © 2020 · 晓白pos网 皖ICP备2022013394号-7