我有一个 Channel 条目标记之外的条件标记,它应该确定 Channel 是否有 1. 条目,2. 过期条目,3. 已关闭条目:我试过{if channel_short_name == "news"}
但不知何故,无论条目是关闭还是过期,它都会返回包装的内容。我有条件的原因是在频道标签之外是我不想重复 h2 标签。
{if there are a displayable entries in the "news" channel, display this whole package.}
   <h2>News</h2>
   <hr />
   {exp:channel:entries channel="news" limit="2"}
      <div class="entry panel">
         <h3>{title}</h3>
         {news_text}
         {if news_full OR news_bild}
            <div id="{entry_id}" class="toggleDiv">
               {news_full}
               {exp:ce_img:single src="{news_bild}" max_width="346" smart_scale="yes" alt="{name_orig}"}
            </div>
            <p><a class="show_hide" rel="#{entry_id}" href="#">Mehr…</a></p>
        {/if}
      </div>
   {/exp:channel:entries}
{/if}
这让我想到另一个问题:
是否可以将过期条目设置为“关闭”?