You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/channels/entries.md
+32-13Lines changed: 32 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1261,33 +1261,52 @@ Handy conditional for displaying markup or content based on whether or not the e
1261
1261
1262
1262
### `{if no_results}`
1263
1263
1264
-
{if no_results} content {/if}
1264
+
{if no_results} There are no entries available {/if}
1265
1265
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.
1267
1267
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).
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.
1275
1273
1276
1274
{if no_results} {redirect="404"} {/if}
1277
1275
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).
1279
1277
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:
1281
1279
```
1282
1280
{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}
1283
1285
{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}
1284
1294
{my_grid_field}
1285
-
{if no_results} Grid is empty {/if}
1286
1295
{my_grid_field:text}
1287
1296
{/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}
1288
1304
{/exp:channel:entries}
1289
1305
```
1290
1306
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
+
1291
1310
### `{if not_category_request}`
1292
1311
1293
1312
{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
1326
1345
1327
1346
Variable pairs contain an opening and closing tag as well as content in between. Example:
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.
1332
1351
1333
1352
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.
1334
1353
1335
1354
### `{date_footer}`
1336
1355
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}
1338
1357
1339
1358
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:
1340
1359
@@ -1354,7 +1373,7 @@ NOTE: **Note:** You can use as many date_footers as you want in the same tag. Th
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:
4
4
5
-
`$ php system/ee/eecli.php hello`
5
+
`$ php system/ee/eecli.php version`
6
6
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.
8
8
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:
12
10
13
11
```
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
20
15
```
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.
21
17
22
-
Commands are also able to take interaction:
18
+
`$ ./system/ee/eecli.php version`
23
19
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:
26
21
27
-
Hello world
28
-
What's your name? Andy
29
-
Pleasure to meet you, Andy!
30
22
```
23
+
$ php system/ee/eecli.php make:addon
31
24
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
+
```
35
29
36
30
## List All Commands
37
31
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:
39
33
40
34
`php system/ee/eecli.php list`
41
35
@@ -44,41 +38,56 @@ This will return a basic list of all available system and user-generated command
| addons:install | Installs add-on and all its components |
46
+
| backup:database | Backup the database |
47
+
| channels:list | Lists all channels in the system |
52
48
| cache:clear | Clears all ExpressionEngine caches |
49
+
| config:config | Updates config values in config.php file |
53
50
...
54
51
```
55
52
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:
(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
+
56
67
## Get Help
57
68
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
59
70
60
71
```
61
-
$ php system/ee/eecli.php hello -h
72
+
$ php system/ee/eecli.php config:config -h
62
73
63
74
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
65
76
66
77
USAGE
67
-
Hello World php eecli.php hello
78
+
Update Config Values php eecli.php config:config -c is_system_on -v n
68
79
69
80
DESCRIPTION
70
-
The most basic of commands
81
+
Updates config values in config.php file
71
82
72
83
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
80
87
81
-
--confirm
82
-
-c
83
-
Test the confirmation
88
+
--value=<value>
89
+
-v <value>
90
+
The value to set the config item to
84
91
```
92
+
93
+
Additional details may also be available here in the ExpressionEngine Docs or on the add-on developer's website.
Copy file name to clipboardExpand all lines: docs/control-panel/create.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,12 +192,16 @@ Saves the entry and returns the [Entry Manager](control-panel/entry-manager.md)
192
192
193
193
### Preview
194
194
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.
196
196
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.
198
198
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.
200
200
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.
202
206
203
207
Live Preview does require the [HTTP Authorization Header be enabled](troubleshooting/error-messages.md#http-authorization-header-missing).
Copy file name to clipboardExpand all lines: docs/fieldtypes/fluid.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -341,10 +341,12 @@ A fluid field can handle the output of all of those fields, as many as they add,
341
341
342
342
## Fluid Field Notes
343
343
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.
346
344
- All native fields aside from a Fluid field can be included in a Fluid field.
347
345
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.
0 commit comments