yiqicms 产品列表,一级栏目和二级栏目拥有不同样式的解决方案

来源:互联网 发布:易语言钩子注入源码 编辑:程序博客网 时间:2024/05/20 23:31

产品列表的代码改成如下代码:

<div class="pro-left">
   <div class="pro-left-tit">产品列表</div>
<div class="pro-left-cen">
  <ul>
{if (count($categorylist) > 0)}
{assign var="categorylist" value=$categorydata->GetCategoryList(0,"product",2)}
{foreach from=$categorylist item=categoryinfo}
{if $categoryinfo->pid > 3}
              
                        <dd><a href="{formaturl type="category" siteurl=$siteurl name=$categoryinfo->filename}">{$categoryinfo->name}</a></dd>
                  
{else}                  
<li><a href="{formaturl type="category" siteurl=$siteurl name=$categoryinfo->filename}">{$categoryinfo->name}</a></li>
{/if}
{/foreach}
{else}
<li>暂无分类</li>
{/if}
</ul>   
</div>
 </div>


二、找到style.css添加不同的样式

        .pro-left-cen ul li{ width:175px; line-height:30px; border-bottom:#CCCCCC 1px dotted; height:30px;  padding-left:25px; background:url(30.gif) no-repeat 10px center;font-weight:bold;}
.pro-left-cen ul dl{ width:175px; line-height:30px; border-bottom:#CCCCCC 1px dotted; height:30px;  padding-left:25px; background:url(26.gif) no-repeat 20px center;}
.pro-left-cen ul dd{ width:170px; line-height:30px; border-bottom:#CCCCCC 1px dotted; height:30px;  padding-left:0px; background:url(bit05.gif) no-repeat 1px center;}

添加这个变量font-weight:bold;使该样式显示粗体。

原创粉丝点击