分类下展示对应分类列表:隐藏不该展示的元素

问题效果:

 

 解决后效果:

 

 

              

 

                <volist name="newscate" id="val" key="idx">                    
<div class="new-left-cont" id="news-li-{$val.id}" <?= $idx !=1 ? 'style="display: none"' : '' ?> > <div class="new-left-all"> <a href="news.html"> <div class="new-left-shang"> <volist name="val.list" id="data"> <div class="new-left-zuo"> <div class="new-left-zuo-img"> <img src="{$data.pic_id|get_cover='path'}" alt=""> </div> </div> <div class="new-left-you"> <h2>{$data.title}</h2> <span>{$data.create_time|time_format='Y-m-d'}</span> <p>{$data.brief}</p> </div> </volist> </div> </a> </div>
                   <volist>