phpcmsV9常用标签

头部:{if isset($SEO[ title ]) && !empty($SEO[ title ])}{$SEO[ title ]}{ if}
  1. 头部:
    <title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
    
    <meta name="keywords" content="{$SEO['keyword']}">
    
    <meta name="description" content="{$SEO['description']}">
    

     

  2. 常用系统常量: {CSS_PATH} {JS_PATH} {IMG_PATH} {APP_PATH}//程序目录例如:

    <link type="text/css" rel="stylesheet" href="{CSS_PATH}qi/index.css" />
    <script type="text/javascript" src="{JS_PATH}qijs/index.js"></script>
    

     

  3. 模板包含:{template "content","header"} {template "content","footer"}这里是引入头部和尾部

  4. 常用调用数据

    {pc:content action="lists" catid="6" num="8" order="inputtime DESC" }
    
    {loop $data $r}
    
    <li><span class="date">({date('Y/m/d H:m:s',$r[inputtime])})</span><a href="{$r[url]}" target="_blank" title="{$r[title]}">{str_cut($r[title],'28')}</a></li>
    
    {/loop}
    
    {/pc}
    
    {str_cut(strip_tags($r[description]), 165)}
    

     

  5. 一级栏目调用:

    {pc:content action="category" catid="0" num="8" siteid="$siteid" order="listorder ASC"}
    
    {loop $data $r}
    
    <li><a href="{$r[url]}" title="{$r[catname]}">{$r[catname]}</a></li>
    
    {/loop}
    
    {/pc}
    

     

  6. 文章列表页调用关键字,或者首页调用关键字:

    {pc:content action="lists" catid="$catid" num="10" order="id DESC" page="$page"}
    
    {loop $data $r}
    
    <a href="{$r[url]}">{$r[title]}</a>
    
    php $keywords = explode(',',$r[keywords]);}
    
    <b>文章标签:</b>
    
    {loop $keywords $keyword}
    
    <a href="{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}" class="blue"> {$keyword}</a>
    
    {/loop}
    
    {/loop}
    
    {/pc}
    

     

  7. 当前栏目名称:{$catname}

  8. 缩略图名称:{$r[thumb]}

  9. 列表内容显示(带分页):

    <div class="news_list2">
    
    <ul>
    
    {pc:content action="lists" catid="$catid" num="20" order="id DESC" page="$page"}
    
    {loop $data $r}
    
    <li><span class="date">{date('Y-m-d H:i:s',$r[inputtime])}</span><a href="{$r[url]}" target="_blank" title="{$r[title]}">{$r[title]}</a></li>
    
    {/loop}
    
    </ul>
    
    <div id="pages" class="text-c">{$pages}</div>
    
    {/pc}
    
    </div>
    

      

      

      

        

您可能有感兴趣的文章
phpcms

phpcms如何使用总结

phpcms 的实用相关接口,函数,调用方法

PHPCMS 概念初学

简单介绍phpcms以及phpcms如何安装?