PHPCMS 模板修改

1.控制首页哪些分类不显示

{loop subcat(0,0,0,$siteid) $r}
{php if($r['catid']==17)break;}
{php $num++}
<div class="box cat-area" {if $num%2!=0}style=" margin-right:10px"{/if}>

2.避免首页分类显示重复

<div class="content">
{php $pic_id=0}  <!-- 图片文章id -->
{pc:content action="lists" catid="$r[catid]" order="id DESC" thumb="1" num="1" return="info"}
{loop $info $v}
{php $pic_id=$v[id]} <!-- 记录图片文章id -->
<p>
<img src="{thumb($v[thumb],90,0)}" width="90" height="60"/>
<strong><a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],44)}</a></strong><br />{str_cut($v['description'],110)}
</p>
{/loop}
{/pc}
<div class="bk15 hr"></div>
{pc:content action="lists" catid="$r[catid]" order="listorder ASC" num="5" return="info"}

 

<!-- 排除图片id -->

{php $cata_num=0} 
{loop $info $v}
{php if( $pic_id==$v[id] ) continue;}
{php $cata_num++}
{php if( $cata_num>4)break;}
<li>·<a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],60)}</a></li>
{/loop}

 

3.导航菜单

最终效果:

素材:

<div class="nav-bar">
  <map>
    <ul class="nav-site">
      <li><a href="http://cng.huiyv.com"><span>首页</span></a></li>
    </ul>
  </map>
</div>

.header .nav-bar {
  clear: both;
  height: 33px;
  overflow: hidden;
  padding-left: 3px;
  height: 40px;
  background: #2B7ACD url(../images/nav_bg.png) no-repeat 0 0;
}

.header .nav-site li {
  float: left;
  padding: 0 5px;
  height: 40px;
  ine-height: 40px;
  background: url(../images/nav_bg.png) no-repeat 100% 0px;
  font-weight: 700;
  font-size: 14px;
  margin-right: 1px;
}

.header .nav-site li a {
  float: left;
  padding: 0 18px;
  height: 40px;
  margin-right: 1px;
  color: #FFF;
}

 .nav-site li a:hover{background:url(../images/nv_a1.jpg) no-repeat 50% 0px;text-decoration:none;}

可能有些样式遗漏需要调整下  

你可能感兴趣的:(phpcms)