Home  >  Article  >  CMS Tutorial  >  How does phpcms determine whether it is the home page?

How does phpcms determine whether it is the home page?

angryTom
angryTomOriginal
2020-02-15 14:44:431847browse

How does phpcms determine whether it is the home page?

phpcms如何判断是不是首页

Phpcms V9判断是否首页具体代码是:

{if !$catid}我是首页{/if}

判断依据是:首页$catid变量为空,所以判断他是否有值即可判定是否首页。

在此,再附带送上只有首页调用友情连接的代码:

{if !$catid}
    
{/if}

这样,就可以放在统一的footer代码里边,自动识别是否首页,如果是首页则调用推荐友情连接,如果不是首页则不显示。

相关推荐:phpcms教程

The above is the detailed content of How does phpcms determine whether it is the home page?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn