首页 未命名内容详情

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

2026-01-10 3 897698882
zblog判断页面是首页分类页内容页独立页面等显示不同内容

站点名称:zblog判断页面是首页分类页内容页独立页面等显示不同内容

所属分类:未命名

官方网址:

SEO查询: 爱站网 站长工具

进入网站

站点介绍

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}