当没有内容的时候显示空白,有则显示整段代码

Mada 3月前 169

我在自定义字段添加了  huida1   huida2   ,想实现当 huida1  huida2 为空的时候 下面<div class="each_list">开始到结尾</div>就会隐藏起来,当huida1 有数据的时候,一整段代码都会显示。

{if:$gdata[huida1]}
                        <div class="each_list">
                                    <dl class="person_dl clearfix">     
			                                  <dt> <img src="/117/912/17912531.png" alt="" width="60" height="60"><i class="top0"></i></dt>
			                                  <dd><span>用户评论#1<i></i></span></dd>
                                                    <dd class="intro">暂无简介</dd>
                                        			                             </dl>
			                             <div class="content_text2">
			                               {$gdata[huida1]}
			                             </div>
                             </div>{/if}
最新回复 (1)
  • houban 3月前
    引用 2
    {if:$gdata[huida1]}
                            <div class="each_list">
                                        <dl class="person_dl clearfix">     
                                                             <dt> <img src="/117/912/17912531.png" alt="" width="60" height="60"><i class="top0"></i></dt>
                                                             <dd><span>用户评论#1<i></i></span></dd>
                                                        <dd class="intro">暂无简介</dd>
                                                                                                 </dl>
                                                        <div class="content_text2">
                                                          {$gdata[huida1]}
                                                        </div>
                                 </div>{else} {/if}
返回
发新帖