Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-29 19:37:09

immarabi
Member
Registered: 2008-04-29
Posts: 57

display message when all articles in the list have expired.

Hello everyone. I love the new <txp:expired /> tag. I have used it to list events on my site. I use the posted date as the beginning of the event and the expired date as the end date for the event. So I have a list of the upcoming events on my front page that are future articles. My article form uses the <txp:if_expired> tag to display only articles that have not expired yet. What I want to do is display a message if there are no upcoming events. So if all my articles in that section have expired and there are no articles listed, how can I display a message that says “there are no events”.

here is my article tag

<ul><txp:article_custom form="customevents" pgonly="1" section="events" sort="Posted asc" time="future" /></ul>

and here is my article form

<txp:if_expired>
<txp:else />
<li><txp:permlink class="elisting">
<txp:posted format="%b %d, %Y %l:%M %P" />: <txp:custom_field name="Event Location" />
</txp:permlink></li></txp:if_expired>



if I add this part after the txp:if_expired tag then the message is displayed, but if there are any future events, they aren't listed. 
<txp:if_first_article><li>Currently there are no confirmed events</li></txp:if_first_article>

Thanks in advance for any help on this.

Last edited by immarabi (2009-04-29 19:40:24)

Offline

#2 2009-04-29 20:28:24

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: display message when all articles in the list have expired.

colak’s reply in this thread should help you as well.

Offline

Board footer

Powered by FluxBB