花褪残红青杏小。燕子飞时,绿水人家绕。

Dutory模板中的一些判断

ZBLOG教程 十五楼的鸟儿 19012浏览 0评论
判断结构多为if else结构
出现在index.html模板的三个判断

判断一:
[code=xml]
$if(!bulletin.ishidden)$
$if(!bulletin.ishidetitle)$

$bulletin.name$

$endif$
$bulletin.content$
$endif$
[/code]
其实是两个判断。
a:此判断表达含义如下:如果后台设置了公告标题显示(!bulletin.ishidetitle)那么显示公告标题;否则隐藏。
[code=xml]$if(!bulletin.ishidetitle)$

$bulletin.name$

$endif$[/code]

b:此判断的表达含义如下:如果后台设置了公告模块显示(!bulletin.ishidden),那么显示公告的所有内容;否则隐藏。
[code=xml]$if(!bulletin.ishidden)$
##判断a的内容##
$bulletin.content$
$endif$[/code]

判断二:此判断表达含义如下:如果没有回复(it.isnocomment),那么显示No Responses,如果有一个回复(it.isonecomment),显示One Response,如果有更多的回复显示 回复总数+Responses ( $it.commentcount$ Responses)
[code=xml]$if(it.isnocomment)$ No Responses $else$ $if(it.isonecomment)$ One Response $else$ $it.commentcount$ Responses $endif$ $endif$[/code]

判断三:此判断应用于文章在首页和分类页显示一部分的情况,如果分割了(it.isexcerpt),那么在分割点开始,显示带有全文链接的“阅读全文”字样。
[code=xml]$it.excerpt$
$if(it.isexcerpt)$阅读全文 »$endif$[/code]


出现在single.html和page.html的一个判断
[code=xml]$if(!it.isclose)$
$comment()$
$endif$[/code]
此判断表达含义如下:如果这篇文章(或者独立页面)不是关闭的,那么显示评论框等内容,否则不显示。

出现在widget.html的一个判断
[code=xml]
$if(it.islist)$
  • $if(!it.ishidetitle)$

    $it.name$

    $endif$
      $it.content$
  • $endif$
    $if(it.ishtmlarea)$
  • $if(!it.ishidetitle)$

    $it.name$

    $endif$
    $it.content$
  • $endif$
    [/code]
    此判断表达含义如下:如果是list类型,那么进入上面的判断,如果是HtmlArea类型,那么进入下面的判断。
    上面和下面判断中各还有一个判断,内容相同:
    [code=xml]
    $if(!it.ishidetitle)$

    $it.name$

    $endif$
    [/code]
    和上面的判断一中的判断a是一样的,如果后台设置模块隐藏标题,那么隐藏模块标题,否则显示模块标题。

    转载请注明:鸟儿博客 » Dutory模板中的一些判断

    与本文相关的文章

    游客
    发表我的评论 换个身份
    取消评论

    Hi,您需要填写昵称和邮箱!

    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址