![](https://img.kancloud.cn/f6/f1/f6f12663cb7682eb68c69e9bc7ea66d4_1920x1048.png) 上面的场景是比较常用的,当你要判断变量不为空时使用`{notempty name='变量名'}{/notempty}`标签,当你要用到循环遍历的时候用`{volist nam='变量名' id='项' empty='' }{/volist}`,如果要用到判断变量值为abc时输出可以用{eq name='变量' value='abc'}{/eq}标签 下面是示例代码: ``` <div class="layout cx-bor cx-bor-white-1 cx-pad-lr15 last-child-remove-line"> {notempty name='readdb.node'} {volist name='readdb.node' id='cx' empty=''} <a href="/home/part-{$cx.id}.html" target="_blank" title="{$cx.title}" class="layout ll-part-hover ll-color-span-hover cx-fex-l cx-fex-itemsc cx-pad-tb15 cx-text-black-6 part" data-id="{$cx.id}" data-class=".num" style="border-bottom: 1px dashed #e5e5e5;"><span class="cx-bg-black-6 cx-bor-raall cx-mag-r10" style="width: 12px;height: 12px;"></span><span>{$cx.title}(<span class="num">0</span>)</span></a> {/volist} {else/} {volist name='partlist' id='cx' empty=''} {eq name='cx.pid' value='$readdb.pid'} <a href="/home/part-{$cx.id}.html" target="_blank" title="{$cx.title}" class="layout ll-part-hover ll-color-span-hover cx-fex-l cx-fex-itemsc cx-pad-tb15 cx-text-black-6 part" data-id="{$cx.id}" data-class=".num" style="border-bottom: 1px dashed #e5e5e5;"><span class="cx-bg-black-6 cx-bor-raall cx-mag-r10" style="width: 12px;height: 12px;"></span><span>{$cx.title}(<span class="num">0</span>)</span></a> {/eq} {/volist} {/notempty} </div> ```