Skip to content

Commit 54fa12d

Browse files
authored
Merge pull request #1150 from ExpressionEngine/docs/stats-status-filter
stats status filter
2 parents bc26c25 + ba1bb58 commit 54fa12d

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

docs/add-ons/statistics.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@ Here is an example of the tag with the parameter in use:
4949
statistics content
5050
{/exp:stats}
5151

52+
### `status=`
53+
54+
status="open"
55+
56+
This parameter can be used to restrict statistics reporting to entries assigned to a particular [status](control-panel/channels.md#statuses-tab). Status-filtered statistics include entries that are not expired and do not have a future entry date. You can choose multiple statuses using a pipe:
57+
58+
status="draft|reviewed|published"
59+
60+
Or exclude statuses using "not"
61+
62+
status="not submitted|processing|closed"
63+
64+
If the `status=` parameter does not include `closed`, closed entries are excluded from the statistics.
65+
66+
Here is an example of the tag with the parameter in use:
67+
68+
{exp:stats channel="news" status="published|reviewed"}
69+
statistics content
70+
{/exp:stats}
71+
5272
## Variables
5373

5474
[TOC=3]
@@ -57,13 +77,13 @@ Here is an example of the tag with the parameter in use:
5777

5878
{last_comment_date format="%m/%d/%Y %h:%i %a"}
5979

60-
The date of the most recent comment. This variable can be affected by the channel= parameter. See [Date Variable Formatting](templates/date-variable-formatting.md) for more information.
80+
The date of the most recent comment. This variable can be affected by the `channel=` and `status=` parameters. See [Date Variable Formatting](templates/date-variable-formatting.md) for more information.
6181

6282
### `{last_entry_date}`
6383

6484
{last_entry_date format="%m/%d/%Y %h:%i %a"}
6585

66-
The date of the most recent entry. This variable can be affected by the channel= parameter. See [Date Variable Formatting](templates/date-variable-formatting.md) for more information.
86+
The date of the most recent entry. This variable can be affected by the `channel=` and `status=` parameters. See [Date Variable Formatting](templates/date-variable-formatting.md) for more information.
6787

6888
### `{last_visitor_date}`
6989

@@ -87,11 +107,11 @@ The total number of people currently online who have chosen to be "anonymous" an
87107

88108
### `{total_comments}`
89109

90-
The combined total number of comments for all entries. This variable can be affected by the channel= parameter.
110+
The combined total number of comments for all entries. This variable can be affected by the `channel=` and `status=` parameters.
91111

92112
### `{total_entries}`
93113

94-
The total number of active entries in the database (not closed and not expired). This variable can be affected by the `channel=` parameter.
114+
The total number of active entries in the database. This variable can be affected by the `channel=` and `status=` parameters. If the `status=` parameter includes `closed`, closed entries are included in this total.
95115

96116
### `{total_guests}`
97117

0 commit comments

Comments
 (0)