Skip to content

Commit efe9664

Browse files
authored
Merge pull request #1167 from ExpressionEngine/7.dev
ExpressionEngine 7.5.27
2 parents 4ef2331 + 47b4489 commit efe9664

6 files changed

Lines changed: 202 additions & 106 deletions

File tree

docs/channels/entries.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,33 +1261,52 @@ Handy conditional for displaying markup or content based on whether or not the e
12611261

12621262
### `{if no_results}`
12631263

1264-
{if no_results} content {/if}
1264+
{if no_results} There are no entries available {/if}
12651265

1266-
You may use this conditional for displaying a message in the case when no entries are returned. The contents inside of the conditional will be displayed in cases where there are no results returned for the tag.
1266+
You will use this conditional frequently to display alternative content when no entries are returned. The content inside the conditional will be displayed when no results are returned for the tag with the given parameters.
12671267

1268-
{if no_results} <p>There are no entries available.</p> {/if}
1269-
1270-
Further, you may specify that another Template be shown in a case when there are no results. In order to do that, you must use the redirect=variable
1268+
Further, you may specify that another page should be shown when there are no results. In order to do that, you use the [redirect= variable](templates/globals/single-variables.md#redirect).
12711269

12721270
{if no_results} {redirect="channel/noresult"} {/if}
12731271

1274-
Lastly, if you want to simply display your 404 page (with 404 headers) when no entries are returned, simply use "404" as the template name.
1272+
Lastly, if you want to simply display your [custom Not Found page](general/404pages.md#404-pages) (with proper 404 headers) when no entries are returned, simply use "404" as the template name.
12751273

12761274
{if no_results} {redirect="404"} {/if}
12771275

1278-
NOTE: **Note:** If you have several nested tags, each one would need to include a `{if no_results}` pair to be parsed correctly.
1276+
NOTE: **Note:** If you have nested tag loops that each check for no results, the outer one will "claim" and process the first (and only the first) `{if no_results}` block before the inner tag loop has a chance, unless the conditional is prefixed (which not every tag provides).
12791277

1280-
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:
1278+
For instance, if you have a Relationship field with an `{if no_results}` block, and the parent `{exp:channel:entries}` tag pair needs to include an `{if no_results}` block as well, you should use this format:
12811279
```
12821280
{exp:channel:entries channel="blog"}
1281+
{my_relationship_field}
1282+
{if my_relationship_field:no_results} Relationship is empty {/if}
1283+
{my_relationship_field:title}
1284+
{/my_relationship_field}
12831285
{if no_results} No entries {/if}
1286+
{/exp:channel:entries}
1287+
```
1288+
1289+
NOTE: **Note:** To test whether a Grid or File Grid field is empty, use [:total_rows](fieldtypes/grid.md#total_rows-1). For a Members field, use [:total_rows](fieldtypes/member.md#total_rows). For a Fluid field, use [:total_fields](fieldtypes/fluid.md#total_fields).
1290+
1291+
```
1292+
{exp:channel:entries channel="blog"}
1293+
{if my_grid_field:total_rows == 0} Grid is empty {/if}
12841294
{my_grid_field}
1285-
{if no_results} Grid is empty {/if}
12861295
{my_grid_field:text}
12871296
{/my_grid_field}
1297+
{if my_fluid_field:total_fields == 0} Fluid field is empty {/if}
1298+
{my_fluid_field}
1299+
{my_fluid_field:text}
1300+
{content}
1301+
{/my_fluid_field:text}
1302+
{/my_fluid_field}
1303+
{if no_results} No entries {/if}
12881304
{/exp:channel:entries}
12891305
```
12901306

1307+
NOTE: **Note:** It is invalid syntax to use `{if:else}` with the `{if no_results}` conditional. Results (no pun intended) may be unpredictable.
1308+
1309+
12911310
### `{if not_category_request}`
12921311

12931312
{if not_category_request} content {/if}
@@ -1326,15 +1345,15 @@ You may test whether an entry is set to be "sticky". You may also test whether i
13261345

13271346
Variable pairs contain an opening and closing tag as well as content in between. Example:
13281347

1329-
{date_heading} <h1>{entry_date format="%Y %m %d"}</h1> {/date_heading}
1348+
{date_heading} <h1>{entry_date format="%Y %m %d"}</h1> {/date_heading}
13301349

13311350
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.
13321351

13331352
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.
13341353

13351354
### `{date_footer}`
13361355

1337-
{date_footer display="daily"} <p>That's all from today!</p> {/date_footer}
1356+
{date_footer display="daily"} <p>That's all from today!</p> {/date_footer}
13381357

13391358
The date footer can be used to show a footer at certain intervals. The interval can be set to show hourly, daily, weekly, monthly, or yearly. An optional "display" parameter can be used to set the display interval:
13401359

@@ -1354,7 +1373,7 @@ NOTE: **Note:** You can use as many date_footers as you want in the same tag. Th
13541373

13551374
### `{date_heading}`
13561375

1357-
{date_heading} <h1>{entry_date format="%Y %m %d"}</h1> {/date_heading}
1376+
{date_heading} <h1>{entry_date format="%Y %m %d"}</h1> {/date_heading}
13581377

13591378
The date heading can be used to show a heading at certain intervals. The interval can be set to show hourly, daily, weekly, monthly, or yearly.
13601379

@@ -1493,7 +1512,7 @@ This variable will be replaced by a URL to the specified Template Group/Template
14931512

14941513
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:
14951514

1496-
{categories} <a href="{path='SITE_INDEX'}">{category_name}</a> {/categories}
1515+
{categories} <a href="{path='SITE_INDEX'}">{category_name}</a> {/categories}
14971516

14981517
#### Custom Category Fields
14991518

docs/cli/usage.md

Lines changed: 48 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
11
# CLI Usage
22

3-
Commands can be called in the terminal of your choice in the format of:
3+
Commands to control and report on many of the core operations of ExpressionEngine can be issued via the terminal of your choice in the format of:
44

5-
`$ php system/ee/eecli.php hello`
5+
`$ php system/ee/eecli.php version`
66

7-
This will call `eecli` with a command of `hello`. This is the Hello World of ExpressionEngine commands, and will display:
7+
Assuming you're in the directory that contains the system folder, this will have `php` use ExpressionEngine's Command Line Interface tool, `eecli`, to run the `version` command.
88

9-
`Hello world`
10-
11-
Commands can also request confirmation:
9+
This is the most basic of ExpressionEngine commands, and will display something similar to:
1210

1311
```
14-
$ php system/ee/eecli.php hello -c
15-
16-
Hello world
17-
Are you liking these questions? (yes/no) [no]
18-
yes
19-
That's good to hear!
12+
ExpressionEngine Version: 7.5.25
13+
Build: 20260623
14+
PHP Version: 8.2.32
2015
```
16+
You may also be able to use the CLI with PHP implied. Command line usage is a broad topic, and the details of your system may vary.
2117

22-
Commands are also able to take interaction:
18+
`$ ./system/ee/eecli.php version`
2319

24-
```
25-
$ php system/ee/eecli.php hello -i
20+
Commands can be interactive and ask you questions as they run. For example, this command will walk you through setting up the files and framework for a custom EE add-on:
2621

27-
Hello world
28-
What's your name? Andy
29-
Pleasure to meet you, Andy!
3022
```
23+
$ php system/ee/eecli.php make:addon
3124
32-
WARN: **Important:** The CLI is available to every user that has SSH or terminal access to your site's webserver. It does not handle authorization inside ExpressionEngine and is relying on your server's authorization method instead.
33-
34-
If you want to disable CLI globally, it can be done by setting `cli_enabled` [configuration override](general/system-configuration-overrides.md#cli_enabled) to `n`.
25+
Let's build your add-on!
26+
What is the name of your add-on?
27+
etc.
28+
```
3529

3630
## List All Commands
3731

38-
To view a list of all available commands, you may use the list command:
32+
To view a list of all available commands, use the list command:
3933

4034
`php system/ee/eecli.php list`
4135

@@ -44,41 +38,56 @@ This will return a basic list of all available system and user-generated command
4438
```
4539
$ php system/ee/eecli.php list
4640
41+
------------------------------------------------------------------
4742
| Command | Description |
4843
------------------------------------------------------------------
49-
| hello | The most basic of commands |
5044
| list | Lists all available commands |
51-
| update | Updates ExpressionEngine |
45+
| addons:install | Installs add-on and all its components |
46+
| backup:database | Backup the database |
47+
| channels:list | Lists all channels in the system |
5248
| cache:clear | Clears all ExpressionEngine caches |
49+
| config:config | Updates config values in config.php file |
5350
...
5451
```
5552

53+
## Command Line Security
54+
55+
WARN: **Important:** Unless disabled, the CLI is enabled by default and available to any person who has SSH or terminal access to your site's web server and who can run PHP scripts. The CLI does not handle authorization using ExpressionEngine's member system. It relies entirely on your server's authorization methods and simply treats a CLI user as a generic superuser.
56+
57+
EE is available via the CLI even when EE is set to offline mode -- this mirrors a superadmin's access permissions in the control panel and makes it possible to perform maintenance and upgrades when a site is offline.
58+
59+
If you want to disable CLI globally, this can be done by setting `cli_enabled` [configuration override](general/system-configuration-overrides.md#cli_enabled) to `n` or by running the following command:
60+
61+
`$ php eecli.php config:config -c cli_enabled -v n`
62+
63+
(This would be a poor choice of command to use to test the CLI.)
64+
65+
You can also enable and disable the CLI from [Security & Privacy Settings](control-panel/settings/security-privacy.md#enable-the-command-line-interface) in the Control Panel.
66+
5667
## Get Help
5768

58-
You can get help information on any command by using the `--help` or `-h` parameter when running the command.
69+
You can get help information for any command by using the `--help` or `-h` parameter
5970

6071
```
61-
$ php system/ee/eecli.php hello -h
72+
$ php system/ee/eecli.php config:config -h
6273
6374
SUMMARY
64-
Hello World -- This is a sample command used to test the CLI
75+
Update Config Values -- Gives the ability to update config values
6576
6677
USAGE
67-
Hello World php eecli.php hello
78+
Update Config Values php eecli.php config:config -c is_system_on -v n
6879
6980
DESCRIPTION
70-
The most basic of commands
81+
Updates config values in config.php file
7182
7283
OPTIONS
73-
--verbose
74-
-v
75-
Hello world, but longer
76-
77-
--interactive
78-
-i
79-
Let's interact!
84+
--config-variable=<value>
85+
-c <value>
86+
The config item to modify
8087
81-
--confirm
82-
-c
83-
Test the confirmation
88+
--value=<value>
89+
-v <value>
90+
The value to set the config item to
8491
```
92+
93+
Additional details may also be available here in the ExpressionEngine Docs or on the add-on developer's website.

docs/control-panel/create.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,16 @@ Saves the entry and returns the [Entry Manager](control-panel/entry-manager.md)
192192

193193
### Preview
194194

195-
A live preview of the entry is available if the relevant channel's [Preview URL](control-panel/channels.md#settings-tab) is set **or** the [Pages Module](add-ons/pages.md) or [Structure](add-ons/structure/overview.md) is installed and configured with a URI and template.
195+
A dynamic, live preview of an entry can be simultaneously displayed while you edit. The preview button opens a split browser window that displays a live preview of the entry you are editing.
196196

197-
If neither is set, the preview button will have an exclamation mark (!) and will link to channel preferences page where Preview URL can be set.
197+
The template used to display the preview is based on configured Pages/Structure fields if the [Pages Module](add-ons/pages.md) or [Structure](add-ons/structure/overview.md) is installed and configured with a URI and template -- or the relevant channel's [Preview URL](control-panel/channels.md#settings-tab) setting otherwise.
198198

199-
The preview will open a split screen that allows a live preview of edits. The template used to display the preview is based on configured Pages/Structure fields if set and the channel preview URL otherwise.
199+
If neither of these is set, the preview button will have an exclamation mark (!) and it will link to channel preferences page where Preview URL can be set.
200200

201-
When the preview is triggered, it is being displayed side-by-side with edit screen. The size of preview container can be adjusted with mouse dragging its border. The preview is dynamically being updated as you change the fields.
201+
NOTE: **Note:** Commonly, the channel preview template is set to be the same template that the live entry, but in certain cases it's useful to use a different, customized preview template. Pages/Structure do not have this flexibility.
202+
203+
NOTE: **Note:** Use the [`{is_live_preview_request}`](globals/single-variables.md#is_live_preview_request) conditional to only display certain content or to modify certain attributes only when previewing an entry. For example, `{if is_live_preview_request}status="open|closed" show_future_entries="yes"{/if}` will preview an entry that is closed or set to publish in the future.
204+
205+
Once the preview is triggered, it will continue to be displayed side-by-side with edit screen until you close it. The size of preview window can be adjusted with the mouse by dragging its border. The preview contents will dynamically update as you change the contents of any field.
202206

203207
Live Preview does require the [HTTP Authorization Header be enabled](troubleshooting/error-messages.md#http-authorization-header-missing).

docs/fieldtypes/fluid.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,12 @@ A fluid field can handle the output of all of those fields, as many as they add,
341341

342342
## Fluid Field Notes
343343

344-
- The `{if no_results}` tag is not valid within the prefixed variable pairs.
345-
- Count variables available in some variable pairs (grid and relationship) restart at 1 each loop. So the total_results for a relationship tag pair would refer to the total number of relationships for that specific instance of the relationship field.
346344
- All native fields aside from a Fluid field can be included in a Fluid field.
347345

346+
- The `{if no_results}` conditional tag is not valid for use in controlling the display of fluid fields. To test if the overall field has any content, use [:total_fields](/fieldtypes/fluid.md#total_fields) outside of the fluid field loop: `{if my_fluid_field:total_fields == 0} Fluid field is empty {/if}`
347+
348+
- Count variables available in some variable pairs (grid and relationship) restart at 1 each loop. So the total_results for a relationship tag pair would refer to the total number of relationships for that specific instance of the relationship field.
349+
348350
## Field Examples
349351

350352
### Checkbox and Multi Select Fields

0 commit comments

Comments
 (0)