category status parameter
Posted: 15 May 2008 11:09 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hi

I tried searching for this but did not find anything useful. I just ran into a problem i never had before or at least did not notice.

Let’s say i have this simple code somewhere in a template:

{exp:weblog:categories weblog="some_weblog" style="linear" status="open"}
  {category_name}
<br />
{/exp:weblog:categories}

Consulting the documentation, this should only show categories for entries in “some_weblog” with the status “open”.

I have added a custom status “draft” for entries being drafted up (obviously) but the problem is, categories for such entries are still showing up.

Am I doing something wrong?

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 15 May 2008 11:15 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15408
Joined  05-15-2004

The way I read it, it will show all categories containing (also) entries of the “open” status. Is that not what you are seeing?

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 15 May 2008 11:18 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

Hm, so if i wanted to “exclude” categories for entries with status “draft” i would write:

status="not draft"

?

Because this does not work either.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 15 May 2008 02:05 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15408
Joined  05-15-2004

I am still a bit unclear about what you are trying to achieve. How many categories do you have? And how many have no postings with a status of “draft” at all? Because these would be the ones that get displayed.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 15 May 2008 02:09 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  04-12-2008

I would like to display only those category names that are associated with entries with the status “open”.

I have some entries with the status “draft” and i don’t want their categories to show up in the listing, the status parameter does not seem to behave as it should.

EDIT: got it working! you need to add show_empty=“no” for the status parameter to work properly. Simply specifying status=“open” will also display entries with other statuses, e.g. draft, as long as you don’t add this - i guess for EE internally, all entries that don’t equal the status specified are handled as “empty”.

{exp:weblog:categories weblog="some_blog" style="linear" status="open"}
{category_name}
{
/exp:weblog:categories}

shows entries with status “draft” for example.

{exp:weblog:categories weblog="some_blog" style="linear" status="open" show_empty="no"}
{category_name}
{
/exp:weblog:categories}

only shows categories associated with entries with status “open”.

Maybe this could be clarified better in the docs.

Regards,
Peter.

 Signature 

Designchuchi | Twitter

URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension

Profile
 
 
Posted: 16 May 2008 02:09 PM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15408
Joined  05-15-2004
peschehimself - 15 May 2008 02:09 PM

EDIT: got it working! you need to add show_empty=“no” for the status parameter to work properly.

Thanks for letting us know, and glad you’re all set.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 16 May 2008 02:09 PM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15408
Joined  05-15-2004

Closing, too.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
   
 
 
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 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64979 Total Logged-in Users: 28
Total Topics: 82018 Total Anonymous Users: 17
Total Replies: 440828 Total Guests: 191
Total Posts: 522846    
Members ( View Memberlist )