Skip to content

Commit e7158c4

Browse files
committed
added docs for orderby filename... as well as a bunch of standardization and small fixes
1 parent 21d0385 commit e7158c4

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

docs/channels/entries.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ You can hard code the channel tag to show a specific channel entry. You may also
277277

278278
entry_id="13|42|147"
279279

280-
Or use "not" to exclude entries::
280+
Or use "not" to exclude entries:
281281

282282
entry_id="not 45|534|807"
283283

@@ -311,15 +311,15 @@ NOTE: **Note:** Using this parameter will automatically constrain the entries ta
311311

312312
### `group_id=`
313313

314-
NOTE: We recommend using [primary_role_id=](#primary_role_id) parameter instead, which works the same but more clearly conveys that the filtering is happening on primary role ID.
314+
NOTE: We recommend using the [primary_role_id=](#primary_role_id) parameter instead, which works the same but more clearly conveys that the filtering is happening on primary role ID.
315315

316316
group_id="4"
317317

318318
You can decide from which Member Role (by specifying the role ID) you wish entries to be shown. If you choose "4", then only entries created by members of the Primary Role with the ID of 4 will be shown. You can choose multiple Roles using a pipe:
319319

320320
group_id="2|3|4"
321321

322-
Or exclude role using "not"
322+
Or exclude roles using "not"
323323

324324
group_id="not 2|3|4"
325325

@@ -368,10 +368,14 @@ The `orderby` parameter sets the display order of the entries. Setting options f
368368
- `orderby="view_count_three"`
369369
- `orderby="view_count_four"`
370370

371-
In addition you can order by a [channel field](control-panel/field-manager/field-manager-settings.md). Use the "short_name" of the field:
371+
In addition, you can order by a [channel field](control-panel/field-manager/field-manager-settings.md). Use the "short_name" of the field:
372372

373373
orderby="name_of_field"
374374

375+
You can also order results by file names:
376+
377+
orderby="file_field:filename"
378+
375379
NOTE: **Note:** Ordering by a Relationship field will cause entries to appear in the order the relationships were made, not based on any content from the related entries.
376380

377381
NOTE: **Note:** **Random** ordered entries have special rules applied. "Sticky" entries will not appear first; they will appear randomly with all other entries. If the tag is not paginated, each page load, a new selection of random entries will be returned. If the tag **is** paginated, then the order of the entries is randomly set on the first page load and stored for the user's session so that entries show up only once in the paginated results.
@@ -398,17 +402,17 @@ Will result in:
398402

399403
Default Site - Entry One - Albert
400404
Default Site - Entry Two - Bobby
401-
Second Site  - Entry One - Alligator
402-
Second Site  - Entry Two - Buffalo
405+
Second Site - Entry One - Alligator
406+
Second Site - Entry Two - Buffalo
403407

404408
If you have multiple Sites where each site has a field with the same exact short name, then you can specify that short name (without the site specified) and ExpressionEngine will treat those two fields as the same value and be able to order them as if they were the same field:
405409

406410
orderby="body"
407411

408412
Default Site - Entry One - Albert
409-
Second Site  - Entry One - Alligator
413+
Second Site - Entry One - Alligator
410414
Default Site - Entry Two - Bobby
411-
Second Site  - Entry Two - Buffalo
415+
Second Site - Entry Two - Buffalo
412416

413417
Thus, the output will then be ordered by the body, regardless of the originating site.
414418

@@ -570,7 +574,7 @@ This example would return all results where the body field is empty.
570574

571575
search:body="not IS_EMPTY"
572576

573-
This example would return all results where the body field is **not** empty, i.e. only entries where the body field had content.
577+
This example would return all results where the body field is **not** empty, i.e., only entries where the body field had content.
574578

575579
The IS_EMPTY search constant can also be used in conjunction with other search terms, for both "Exact" and "Contains" type matching.
576580

@@ -590,13 +594,13 @@ NOTE: **Note:** You may use multiple search: parameters in a channel entries tag
590594

591595
{exp:channel:entries search:style="=ale" search:region="germany|belgium" search:rating="=3|4|5"}
592596

593-
When using multiple search parameters, all search parameters must be matched in order for an entry to be included. The above example would pull back only those entries where the style is 'ale', the region is 'germany' or 'belgium' and the rating is 1, 2 or 3.
597+
When using multiple search parameters, all search parameters must be matched in order for an entry to be included. The above example would pull back only those entries where the style is 'ale', the region is 'germany' or 'belgium', and the rating is 3, 4, or 5.
594598

595599
### `show_current_week=`
596600

597601
show_current_week="yes"
598602

599-
Requires use of the [display_by=](#display_by) "week" parameter. When set to "yes", it displays the current week by default (i.e. no pagination in the URL) and automatically adjusts the pagination links to indicate the correct page for that week.
603+
Requires use of the [display_by=](#display_by) "week" parameter. When set to "yes", it displays the current week by default (i.e., no pagination in the URL) and automatically adjusts the pagination links to indicate the correct page for that week.
600604

601605
### `show_expired=`
602606

@@ -739,15 +743,15 @@ This parameter limits the query by username. You can use the pipe character to q
739743

740744
username="tom|dick|harry"
741745

742-
Or you can add "not" to exclude usernames
746+
Or you can add "not" to exclude usernames:
743747

744748
username="not tom|dick|harry|fred"
745749

746750
You can also use the token `"CURRENT_USER"` to show entries from only the currently logged in user.
747751

748752
username="CURRENT_USER"
749753

750-
This allow each logged-in user to get only their entries. Users who are not logged in won't see anything. Alternatively, you can use the token `"NOT_CURRENT_USER"` to show entries **except** from the currently logged in user.
754+
This allows each logged-in user to get only their entries. Users who are not logged in won't see anything. Alternatively, you can use the token `"NOT_CURRENT_USER"` to show entries **except** from the currently logged-in user.
751755

752756
username="NOT_CURRENT_USER"
753757

@@ -791,7 +795,7 @@ If five entries are being displayed per page, then for the fourth entry on the s
791795

792796
### `{absolute_index}`
793797

794-
Similar to `absolute_count` but starts at 0 instead of 1. So the first entry will have value of "0" and the second entry will have a value of "1" etc.
798+
Similar to `absolute_count` but starts at 0 instead of 1. So the first entry will have a value of "0" and the second entry will have a value of "1", etc.
795799

796800
### `{absolute_results}`
797801

@@ -839,7 +843,7 @@ The name of the channel that the currently displayed entry is assigned to.
839843

840844
### `{channel_id}`
841845

842-
The ID number of the actual channel (not the _entry_.)
846+
The ID number of the actual channel (not the _entry_).
843847

844848
### `{channel_short_name}`
845849

@@ -969,7 +973,7 @@ The date on which the entry was last edited in GMT. This variable is **not** loc
969973

970974
### `{index}`
971975

972-
Similar to `count` but starts at 0 instead of 1. So the first entry will have value of "0" and the second entry will have a value of "1" etc.
976+
Similar to `count` but starts at 0 instead of 1. So the first entry will have a value of "0" and the second entry will have a value of "1", etc.
973977

974978
### `{ip_address}`
975979

@@ -985,13 +989,13 @@ This variable is replaced by a URL that passes the author's member name to your
985989

986990
### `{page_uri}`
987991

988-
If you have the Pages Module installed and if you have associated a static page with a channel entry (via the "Pages" section of the Publish tab), this is the page uri for the page. It will typically be used like so:
992+
If you have the Pages Module installed and if you have associated a static page with a channel entry (via the "Pages" section of the Publish tab), this is the page URI for the page. It will typically be used like so:
989993

990994
{if page_uri != ''} <a href="{page_uri}">View this page</a> {/if}
991995

992996
### `{page_url}`
993997

994-
If you have the Pages Module installed and if you have associated a static page with a channel entry (via the "Pages" section of the Publish tab), this is the page url for the page (the site URL + the page URI). It will typically be used like so:
998+
If you have the Pages Module installed and if you have associated a static page with a channel entry (via the "Pages" section of the Publish tab), this is the page URL for the page (the site URL + the page URI). It will typically be used like so:
995999

9961000
{if page_url != ''} <a href="{page_url}">View this page</a> {/if}
9971001

@@ -1071,7 +1075,7 @@ The width of the signature image associated with the entry's author. Typically u
10711075

10721076
### `{status}`
10731077

1074-
The status of the entry (open, closed, etc.)
1078+
The status of the entry (open, closed, etc.).
10751079

10761080
### `{switch}`
10771081

@@ -1156,19 +1160,19 @@ Conditionals allow you to more precisely control your content.
11561160

11571161
NOTE: **Note:** A more complete explanation of conditional control structures and operators can be found on the [Conditional Tags](templates/conditionals.md) page.
11581162

1159-
Here is an example that tests for the "summary" field being not empty
1163+
Here is an example that tests for the "summary" field being not empty:
11601164

11611165
{if summary != ""}
11621166
The summary is not empty!
11631167
{/if}
11641168

1165-
An alternate, shorthand syntax can accomplish the same thing
1169+
An alternate, shorthand syntax can accomplish the same thing:
11661170

11671171
{if summary}
11681172
The summary is not empty!
11691173
{/if}
11701174

1171-
If only the variable name is in the conditional statement it tests for "not empty".
1175+
If only the variable name is in the conditional statement, it tests for "not empty".
11721176

11731177
Many of the single variables can be used in a conditional. You may always use the short name of one of your custom entry fields in a conditional. In addition, there are several unique conditionals.
11741178

@@ -1250,7 +1254,7 @@ Lastly, if you want to simply display your 404 page (with 404 headers) when no e
12501254

12511255
NOTE: **Note:** If you have several nested tags, each one would need to include a `{if no_results}` pair to be parsed correctly.
12521256

1253-
For instance, if you have Grid field with `{if no_results}` block, the parent `{exp:channel:entries}` tag pair would need to include `{if no_results}` block as well.
1257+
For instance, if you have a Grid field with an `{if no_results}` block, the parent `{exp:channel:entries}` tag pair would need to include an `{if no_results}` block as well:
12541258
```
12551259
{exp:channel:entries channel="blog"}
12561260
{if no_results} No entries {/if}
@@ -1297,13 +1301,13 @@ You may test whether an entry is set to be "sticky". You may also test whether i
12971301

12981302
[TOC=3]
12991303

1300-
Variable pairs contain an opening and closing tag as well as content in-between. Example:
1304+
Variable pairs contain an opening and closing tag as well as content in between. Example:
13011305

13021306
{date_heading} <h1>{entry_date format="%Y %m %d"}</h1> {/date_heading}
13031307

13041308
The reason variable pairs have an opening and closing pair is because the information between the pairs can be shown or not shown if the criteria for each tag is met.
13051309

1306-
In the case of the "date_heading" pair, for example, it only appears at a certain interval that you set (hourly, daily, weekly, monthly, etc.). By using a pair of variables you can put HTML formatting between them that only gets shown when the interval is met. Otherwise, the chunk is not displayed.
1310+
In the case of the "date_heading" pair, for example, it only appears at a certain interval that you set (hourly, daily, weekly, monthly, etc.). By using a pair of variables, you can put HTML formatting between them that only gets shown when the interval is met. Otherwise, the chunk is not displayed.
13071311

13081312
### `{date_footer}`
13091313

@@ -1462,9 +1466,9 @@ The category ID associated with the category's parent (or 0 in the case of a top
14621466

14631467
{path='channel/index'}
14641468

1465-
This variable will be replaced by a URL to the specifies Template Group/Template. The category designation information will automatically be added to the end of the URL so that the target page will know which category to display.
1469+
This variable will be replaced by a URL to the specified Template Group/Template. The category designation information will automatically be added to the end of the URL so that the target page will know which category to display.
14661470

1467-
If you want the category links to point to your site index instead of a particular template group/template you can use SITE_INDEX instead:
1471+
If you want the category links to point to your site index instead of a particular template group/template, you can use SITE_INDEX instead:
14681472

14691473
{categories} <a href="{path='SITE_INDEX'}">{category_name}</a> {/categories}
14701474

0 commit comments

Comments
 (0)