当前位置:首页 > 未命名

zblog判断页面是首页分类页内容页独立页面等显示不同内容

8976988823个月前 (01-10)未命名4

zblog的仿站跟dede有很大不同,dede不同页面有不同的代码文件,zblog里面一个页面是由多个不同代码文件组合而成,这时候就需要进行判断,在什么页面的情况下显示什么样的内容。

{if $type=='index'&&$page=='1'}  /*判断首页*/{if $type=='category'}  /*判断分类页*/{if $type=='article'}  /*判断内容页*/{if $type=='page'}  /*判断独立页面*/{if $type=='author'}  /*判断用户页*/{if $type=='date'}  /*判断日期页*/{if $type=='tag'}  /*判断标签页*/

写全了

{if $type=='index'&&$page=='1'}  /*判断首页*/{template:index_default}{elseif $type=='category'}  /*判断分类页*/{$category.Name}{elseif $type=='article'}  /*判断日志页,不含独立{$article.Title}{template:index_artile}{elseif $type=='page'}  /*判断独立页面*/{template:index_page}{elseif $type=='author'}  /*判断用户页*/{$author.Name}/{$author.StaticName}{elseif $type=='date'}  /*判断日期页*/date- {$title}{elseif $type=='tag'}  /*判断标签页*/{$tag.Name}{else}{$title}{/if}


扫描二维码推送至手机访问。

版权声明:本文由米表程序发布,如需转载请注明出处。

本文链接:https://www.9909999.xyz/post/419.html

分享给朋友: