Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8821547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:52:58+00:00 2026-06-14T05:52:58+00:00

I have a Conditional Outside a Channel entries tag which should determin if a

  • 0

I have a Conditional Outside a Channel entries tag which should determin if a Channel has 1. Entries at all, 2. Expired entries, 3. Closed entries:
I tried {if channel_short_name == "news"}
But somehow that returns the wrapped content no matter if entries are closed or expired.
The reason that I have the conditional is outside the channel tag is that I dont want to repeat the h2 tag.

{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}

This brings me to another question:

Is it possible to set expired entries to “closed”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:52:59+00:00Added an answer on June 14, 2026 at 5:52 am

    The simplest option would be to move your header markup into a conditional that is only displayed with the first entry. If there are no results then the {exp:channel:entries} tag will generate no output.

    {exp:channel:entries channel="news" limit="2"}
        {if count == '1'}
            <h2>News</h2>
            <hr />
        {/if}
        <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}
    

    Is there any particular reason why you want to close expired entries? Unless you’re using show_expired = 'yes' all expired entries will behave as if they’re closed anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic conditional statement that has a chaining function. After the else
I have a question which I think involves conditional entropy in the field of
I have a UserControl which contains voting buttons inside an UpdatePanel, and outside a
I have problem using jstl tag <c:if> in jsp file. Basically I should make
We have a WCF service which will be accessed from outside systems. Under certain
I have a RadGrid which on RowClick should send a specific value to the
I have this conditional in a perl script: if ($lnFea =~ m/^(\d+) qid\:([^\s]+).*?\#docid =
I have some conditional formatting styles. I don't want to keep creating new rules
Suppose I have a conditional statement without brackets in a function: function get_user_id() {
I have this: As you can see I currently have a conditional to include

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.