30Blog

ZBlog development tutorial: separating page judgment from home page and classified list page

ZBlog page judgment writing method:

 {if $type=='index '&&$page=='1'}/* Judge the first page*/ {if $type=='category '}/* Judge the category page*/ {if $type=='article'}/* Judge log page, not including independent page, {if $article. Type==ZC_POST_TYPE_ARTICLE} (another scheme)*/ {if $type=='page '}/* Judge independent pages*/ {if $type=='author '}/* Judge user page*/ {if $type=='date '}/* Judge the date page*/ {if $type=='tag '}/* Judge the tab*/

ZBlog homepage and category list page are written separately:

Make judgment in the index.php file and separate the template. For example:

 {if $type=='index'&&$page=='1'}  {template:c_index} {else} {template:c_list} {/if}

Then create two corresponding template files: c_index.php and c_list.php

QQ pre-sales consultation