show all status
Posted: 29 January 2008 06:56 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  191
Joined  06-04-2007

is there any way to show all statuses no matter what their status is, without having to list each status? status=“closed|open|important|stupid”
something like status=”*” ?

Profile
 
 
Posted: 30 January 2008 04:41 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10831
Joined  04-15-2006

Hi Vinci,

Hmmm my first thought was to try taking out the status parameter completely from the weblog tag but that won’t work as it will just bring back the open status entries. I don’t think from looking at the documentation that there is an easy way of programming that.

My second thought was to create a new status, call it whatever you like and then use the status=“not status_name” and that should show everything else but I was scuppered on that one too as the closed status entries don’t show then. I did try seeing if I could do status=“closed not none” but that didn’t seem to work either so to cut a long story short and to answer your question I don’t think that there is an in-built way of getting what you need.

You could perhaps use some PHP on the template though to spit out all the status names for you?

Hope that helps a bit?

Also if anyone does know a way of doing this then please do tell as I may have just programmed it wrong somewhere and maybe it does in fact work?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 30 January 2008 04:56 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21031
Joined  04-29-2002

What, Mark… you can’t think of a method to do this with a PHP query, and turn it into a plugin that would show all statuses except closed?

Ducking and running away… smile

 Signature 

EE 2.01PB - 2.x Bug Tracker | Docs | Upgrade from 1.x to 2.x | Build Update Instructions | 1.6.x Update Info

Most recent 2.x version: Build 20100215
Don’t forget to upgrade MSM and Forum as needed!

Profile
MSG
 
 
Posted: 30 January 2008 05:35 AM   [ Ignore ]   [ # 3 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10831
Joined  04-15-2006

Throwing chalk at Sue now!! wink

Hi Sue,

Well that was my thought on the matter. It can be done with a plugin but I just don’t really have the time at the moment to create one plus then you have to make the plugin know which status group you want to query and you have to write up the docs and zip it all up for the forums!! grin

I might give this a go today if I get the time though.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 30 January 2008 07:40 AM   [ Ignore ]   [ # 4 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10831
Joined  04-15-2006

Hiya,

I think I have something working for you.

Please please please do test this out on a dev install before going live as I haven’t really had any time to test this out thoroughly and I won’t be held responsible for any madness caused if this goes Kaputt!! grin

That said, here goes!!


Usage

Put this tag pair around a weblog tag in place of the status parameter. There is one parameter which is required
which is the group=”” parameter. Set this to the name of your status group.

eg.

{exp:retrieve_statuses group="Default Status Group" parse="inward"}

{exp
:weblog:entries weblog="default_site" status="{statuses}"}
{title}
<br />
{/exp:weblog:entries}

{
/exp:retrieve_statuses}

The parse=“inward” is a requirement and must be there in order for this to work correctly.

Again please do test this out thoroughly and I will do my best to fix it if it doesn’t work but I am exceptionally busy at the moment so I am just hoping that this thing works out of the box so to say!! grin

Hope it does work and hope it helps.

Best wishes,

Mark

File Attachments
pi.retrieve_statuses.php.zip  (File Size: 2KB - Downloads: 392)
 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 31 January 2008 06:20 AM   [ Ignore ]   [ # 5 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10831
Joined  04-15-2006

Hiya Vinci,

Just wondering if this was any good to you at all?

Let me know how it goes.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 08 February 2008 01:15 PM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  148
Joined  04-14-2004

Mark, a thought, somewhat unrelated, but maybe you’ll like the idea enough to add it to your plugin, or create another version ...

Let’s say I want to have a single template which shows closed, draft and open entries to members in groups 1 and 7, and only open entries to everyone else.  To do this currently, you need to do:

{if member_group == "1" || member_group == "7"}
  {
!-- either the full weblog entry loop, or an embed with a parameter of statuses:open|closed|draft, and the weblog entries loop must live in a separate template. --}
{if
:else}
  {
!-- the weblog entries loop repeated --}
{
/if}

What if instead we built off your plugin so that there was a variable called groups, which stored member groups who could see all statuses, and another parameter called public, which stored statuses for everyone else:

{exp:retrieve_statuses group="Default Status Group" groups="1|7" public="open" parse="inward"}

{exp
:weblog:entries weblog="default_site" status="{statuses}"}
  {
!-- weblog data goes here --}
{
/exp:weblog:entries}

{
/exp:retrieve_statuses}

What do you think?

 Signature 

http://www.cameroncorda.com | http://www.bluestatedigital.com

Profile
 
 
Posted: 09 February 2008 08:08 PM   [ Ignore ]   [ # 7 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10831
Joined  04-15-2006

Hi Cameron,

Sorry I hadn’t replied to this yet but my e-mail program for some reason showed the reminder as read and I definitely hadn’t read it yet.

Yes that sounds like a great idea. I will put that on my list of things to do but unfortunately I can’t promise anything straight away as I am very busy at the moment designing a couple of sites so this will have to take a slight back-burner I’m afraid. Does sound like a great idea though so will look into this.

When you say you want closed, draft and open statuses to work for the group parameter do you really mean all the statuses in that group? I just ask as a lot of people do create other statuses other than the standard open, closed and draft statues.

I could probably make a plugin that allows the group parameter to see all statuses but people who aren’t get to just see open status entries if that is what you mean?

Very very good idea though and I’m sure it will help people out.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 09 February 2008 09:46 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  148
Joined  04-14-2004

Mark, my basic goal is to be able to show all statuses in the system to admin users, and a certain subset to guests.  Maybe I have a blog with statuses of Featured (which show up on the homepage), and Open, Draft, Closed.

On the blog/entry template, I want to be able to preview posts that are in draft before they go live, as with the new live look feature.  So I want member groups 1 & 7 to have the weblog loop show all four statuses.  Everyone else should only see Open|Homepage.

With the following code:
{exp:retrieve_statuses group=“Default Status Group” admin_groups=“1|7” public_statuses=“open|homepage” parse=“inward”}

The group parameter would function like it currently does, pulling all statuses.

The admin_groups parameter tells the system that if the user is in one of those groups, it has access to all statuses.

The public_statuses parameter would show those statuses to to everyone else.  Another option might be to use the syntax public_statuses=“not draft|closed”.

Does that make sense?

 Signature 

http://www.cameroncorda.com | http://www.bluestatedigital.com

Profile
 
 
Posted: 12 March 2009 07:20 PM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  25
Joined  03-04-2009
{exp:retrieve_statuses group="Default Status Group" admin_groups="1|7" public_statuses="open|homepage" parse="inward"}

Would this not be possible naively in EE by wrapping the plugin call(s) in a series of conditionals (as you did above) to determine who the user is (admin level or public), and then load a different custom status group to the plugin based on each? 

{if member_group == "1" || member_group == "7"}
  {exp
:retrieve_statuses group="Admin_Level_Status_Group" parse="inward"}

   
(Only admins can see these groups)  

{if:else}
  {exp
:retrieve_statuses group="Public_Level_Status_Group" parse="inward"}
   
   
(Everyone can see these groups)  

{/if}

 

(Caveat: I have not tested the above, and I’m very new to EE, so I might have no idea what I’m talking about! I don’t have the plugin installed to test. Please correct me if there are errors in the above.)

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 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120472 Total Logged-in Users: 63
Total Topics: 126549 Total Anonymous Users: 34
Total Replies: 665393 Total Guests: 305
Total Posts: 791942    
Members ( View Memberlist )