Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Status==“closed” doesn’t display
Posted: 08 September 2004 04:41 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  488
Joined  2004-05-14

In my individual archives, I am attempting to leave a message behind for readers when an Article is closed.  However, using {if status==“closed”} (or “Closed”) doesn’t display anything.  Also {status<>“open”} doesn’t work.

Any ideas?  Possible bug?  I can’t believe that its a designed that way.  I must be doing something wrong.  EE latest build version.

{if status="closed"}
This Article has been Closed
.  It is no longer publically Viewable.
If
you have questions, please use the Contact Form Provided.
Thank You.
{/if}

 Signature 

Far From Perfect
Broadcasting live from Iraq via High-speed Bytes/Second Internet!

Profile
 
 
Posted: 08 September 2004 11:21 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  2001-12-21

That’s because closed entries are never fetched by the query, so there is nothing “closed” to test for.

Rather than looking for closed entries, try using this:

{if no_results}
This article is gone! Doh!
{/if}

 Signature 
Profile
 
 
Posted: 08 September 2004 11:38 PM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  2002-06-19

(FYI: you posted this in a pMachine forum)

You can, of course, include “closed” entries in your list by specifying it with the status= parameter.  To get what (I think) you want, you could try something like this:

{exp:weblog:entries weblog="yourweblog" status="open|closed"}

{if status
== "closed"}
  This Article has been Closed
.  It is no longer publically Viewable.
  If
you have questions, please use the Contact Form Provided.
  
Thank You.
{/if}

{if status
!= "closed"}

  {title}

  {body}

{
/if}

{
/exp:weblog:entries}

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 09 September 2004 11:19 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12273
Joined  2002-04-29

The only thing I would add to Chris’ suggestion is to put in the {title} field so they at least know *which* article is closed. smile

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
 
 
Posted: 09 September 2004 12:47 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  488
Joined  2004-05-14

Thanks.  My problem was with putting it outside the exp:weblog:entries container.

BTW, the {title} won’t work since the article is closed and therefore never parsed from the database.

 Signature 

Far From Perfect
Broadcasting live from Iraq via High-speed Bytes/Second Internet!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 64515 Total Logged-in Users: 0
Total Topics: 81075 Total Anonymous Users: 0
Total Replies: 436313 Total Guests: 18
Total Posts: 517388    
Members ( View Memberlist )
Active Members: