Skip to content

Commit fa40b64

Browse files
authored
Update entries.md
Rearranged conditionals, small wording changes.
1 parent d7870c7 commit fa40b64

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

docs/comment/entries.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Here is a basic example showing how you might use the comment tag:
2222
<p>By {name} on {comment_date format="%Y %m %d"}</p>
2323
{/exp:comment:entries}
2424

25-
NOTE: **Important:** The Comment Entries tag should **not** be nested inside of a standard {exp:channel:entries} tag.
25+
NOTE: **Important:** The Comment Entries tag should **not** be nested inside of a standard {exp:channel:entries} tag. If you do, the outer tag will parse and resolve many of these variables and conditionals before the Comment Entries tag has the chance to do so.
2626

2727
## Parameters
2828

@@ -158,12 +158,6 @@ This variable will always display the absolute total number of results that are
158158

159159
The _opposite_ of `{absolute_count}`, in that it displays the entry count position counting backwards from the absolute total. Works across pagination, so the fifth entry in a list of fifteen entries would display "10".
160160

161-
### `{allow_comments}`
162-
163-
{if allow_comments}
164-
165-
TRUE / FALSE, Whether or not the entry being displayed allows comments. Typically used as a conditional.
166-
167161
### `{author}`
168162

169163
The comment author's screen name, if a member; otherwise, this variable will display the name submitted with the comment.
@@ -196,10 +190,6 @@ The URL to the avatar image associated with the entry's author. Typically used a
196190

197191
{if avatar} <img src="{avatar_url}" width="{avatar_image_width}" height="{avatar_image_height}" alt="{author}'s avatar" /> {/if}
198192

199-
### `{if can_moderate_comment}`
200-
201-
TRUE / FALSE, Whether a member has permission to edit a given comment AND/OR close that comment. Used in conjunction with [comment editing](comment/form.md#allowing-members-to-edit-comments-on-the-front-end).
202-
203193
### `{channel_id}`
204194

205195
The ID number of the channel that the comment belongs to.
@@ -289,12 +279,6 @@ If five entries are being displayed per page, then for the fourth entry on the p
289279

290280
The date on which the comment was edited. See [Date Variable Formatting](templates/date-variable-formatting.md) for more information.
291281

292-
### `{editable}`
293-
294-
{if editable}Show Edit{/if}
295-
296-
This variable will be used in a conditional to allow [comment editing](comment/form.md#allowing-members-to-edit-comments-on-the-front-end). It indicates whether a member has [permission to edit a given comment](control-panel/member-manager.md#createedit-all-member-roles).
297-
298282
### `{email}`
299283

300284
The comment author's email address, if specified.
@@ -453,7 +437,15 @@ These are totally dynamic in that any profile field you create for your members
453437

454438
[TOC=3]
455439

456-
The following special conditionals are available:
440+
The following special conditionals are available.
441+
442+
NOTE: **Important:** Avoid using Template Caching on any Template containing these conditional that are user-specific. If you do not avoid caching, then data will not be dynamic for each user. Instead, whoever happens to load the page when it gets cached will have their conditionals applied to every subsequent visitor until the cache expires.
443+
444+
### `{if allow_comments}`
445+
446+
{if allow_comments} content {/if}
447+
448+
TRUE / FALSE, Whether or not the entry being displayed allows comments. Typically used as a conditional.
457449

458450
### `{if avatar}`
459451

@@ -463,20 +455,32 @@ This special conditional lets you conditionally display content if the current e
463455

464456
{if avatar} <img src="{avatar_url}" width="{avatar_image_width}" height="{avatar_image_height}" alt="{author}'s avatar" /> {/if}
465457

458+
### `{if can_moderate_comment}`
459+
460+
TRUE / FALSE, Whether a member has permission to edit a given comment AND/OR close that comment. Used in conjunction with [comment editing](comment/form.md#allowing-members-to-edit-comments-on-the-front-end).
461+
466462
### `{if comments_expired}`
467463

464+
{if comments_expired} content {/if}
465+
468466
If commenting has expired (and expiration is not set to be [overridden by moderation](comment/control-panel.md)), the contents of this conditional will be displayed.
469467

470468
NOTE: **Note:** `{if no_results}` has precedence over this conditional. If there are no comments, this conditional is not evaluated.
471469

472470
### `{if comments_disabled}`
473471

474-
{if comments_disabled}
472+
{if comments_disabled} content {/if}
475473

476474
If commenting has been disabled, the contents of this conditional will be displayed.
477475

478476
NOTE: **Note:** `{if no_results}` has precedence over this conditional. If there are no comments, this conditional is not evaluated.
479477

478+
### `{if editable}`
479+
480+
{if editable} Show Edit Form {/if}
481+
482+
TRUE / FALSE, This variable will be used in a conditional to allow [comment editing](comment/form.md#allowing-members-to-edit-comments-on-the-front-end). It indicates whether a member has [permission to edit a given comment](control-panel/member-manager.md#createedit-all-member-roles).
483+
480484
### `{if is_ignored}`
481485

482486
{if is_ignored} content {/if}
@@ -509,7 +513,7 @@ Or you can use Javascript to allow the user to read the comment if they wish:
509513
<div id="{comment_id}" {if is_ignored}style="display: none;"{/if}>{comment}</div>
510514
{/exp:comment:entries}
511515

512-
NOTE: **Important:** Avoid using Template Caching on any Template containing this conditional. If you do not avoid caching, then data will not be dynamic for each user. Instead, whoever happens to load the page when it is cached will have their ignore list applied to everyone until the cache expires.
516+
NOTE: **Important:** Avoid using Template Caching on any Template containing this conditional. If you cache this, whoever happens to load the page when it is first cached will have their ignore list applied to everyone until the cache is cleared.
513517

514518
### `{if no_results}`
515519

0 commit comments

Comments
 (0)