Skip to content

Commit 2043b2c

Browse files
authored
Update frontend.md
Huge cleanup of this.
1 parent c5be66b commit 2043b2c

1 file changed

Lines changed: 54 additions & 43 deletions

File tree

docs/advanced-usage/front-end/frontend.md

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,90 +12,91 @@
1212
[TOC]
1313

1414
## Overview
15-
For users with the appropriate level of access, ExpressionEngine Pro adds "front edit" links ( <img style="margin-bottom: 0px; vertical-align: middle; display:inline-block;" src="../../_images/pro_edit.png" alt="pro edit icon"> ) on the site's front-end that allow editing the contents of each entry field individually. This is done directly on front-end without going to the Control Panel.
15+
For any user logged in with a sufficient level of access permissions, ExpressionEngine Pro adds "front edit" links ( <img style="margin-bottom: 0px; vertical-align: middle; display:inline-block;" src="../../_images/pro_edit.png" alt="pro edit icon"> ) that allow editing an entry's data field by field. When enabled, editing (with live preview!) can be done directly on front-end without needing to go to the Control Panel.
1616

17-
Clicking the link opens a popup with the field that can be modified and saved. Along with editing, users can also use front edit popup to access the full entry for editing with live preview showing the current page you are on.
17+
Clicking the link icon opens a popup for that specific field so that its content can be modified and saved. The user can also switch to a full entry interface for editing with live preview functionality that shows the changes dynamically affecting the page they are currently on.
1818

1919
![edit popup](_images/ee-pro-window.png)
2020

21-
The links are being placed in your HTML right before the field's tag (or opening tag if field tag pair is used).
21+
By default, edit links are added into the HTML right before where the field tag is called (the opening tag if a field tag pair is used).
2222

23-
WARN:**Permissions:** Users must be logged-in on the front-end of your site and must have a role assigned to them which allows them to access and edit content for that entry's channel.
23+
WARN:**Permissions:** Users must be: a) logged-in on the front-end of the site and b) must have a role assigned to them which allows them to access and edit content for that entry's channel.
2424

2525
![channel access](_images/ee-role-channel-access.png).
2626

2727
## Saving Content
28-
After editing data, content can be saved by one of two ways:
29-
- Clicking on "Save", which will trigger a page reload
28+
29+
After editing data, content can be saved in one of two ways:
30+
- Clicking directly on "Save", which will trigger a page reload
3031

3132
![save](_images/ee-pro-save.png)
3233

33-
- Clicking the alternate "Save without Reload", which will save the content without reloading the page. This would require a manual page refresh to see any updated content.
34+
- Clicking the alternate "Save without Reload" choice, which will save the content but will not reload the page. This choice requires a manual page refresh to see any updated content but is quicker, especially if you are planning to edit multiple fields or entries on a page.
3435

3536
![save without reload](_images/ee-pro-save-reload.png)
3637

3738
## Unsaved Changes
38-
When a user edits data and has unsaved changes, Pro will create an autosave of the entry and alert the user via a notification on the edit window with unsaved changes. The autosave is triggered based on the default autosave interval of 60 seconds. If you want to ensure users do not accidentally lose unsaved changes adjust the `[autosave_interval_seconds]` system config override to a lower interval between autosaves. A setting of 10 seconds is the recommendation.
39+
40+
When a user has edited data and has unsaved changes, Pro will create an autosave of the entry and display an alert notification on the edit window with the unsaved changes. The autosave is triggered based on the autosave interval setting. If you want to ensure users do not accidentally lose unsaved changes, adjust the `[autosave_interval_seconds]` [system config override](general/system-configuration-overrides.md#autosave_interval_seconds) to a shorter interval between autosaves. A setting of 10 seconds is recommended.
3941

4042
![unsaved changes](_images/pro_unsaved_changes.png)
4143

42-
NOTE: **Note:** If the `[autosave_interval_seconds]` system config value was not previously changed, Pro will set this value at 10 seconds upon install.
44+
NOTE: **Note:** If the `[autosave_interval_seconds]` system config value was not previously set, upon install, Pro will set this value in the config file to be 10 seconds. However, if for some reason this value is not set explicitly, the default value is 60 seconds.
45+
46+
NOTE: **Note:** Autosave data is kept for a default of 6 hours. This can be adjusted via the [`[autosave_prune_hours]` system config value](general/system-configuration-overrides.md#autosave_prune_hours).
4347

4448
Example Usage:
4549

4650
```
47-
$config['autosave_interval_seconds'] = '10';
51+
$config['autosave_interval_seconds'] = '10';
52+
$config['autosave_prune_hours'] = '6';
4853
```
49-
## Conditional Tags
50-
51-
### `{if frontedit}`
52-
53-
```{if frontedit} content {/if}```
54-
55-
This special conditional allows you to display content if front-end editing is enabled.
56-
5754

58-
## Enable/Disable The Front Edit Link
55+
## Enable/Disable the Front Edit Links
5956

60-
There are several ways to disable front-end editing links:
61-
- Globally with [configuration overrides](/general/system-configuration-overrides.md#enable_frontedit_links) or in [General Settings](/control-panel/settings/front-end-editing.md#enable-automatic-front-end-editing-links)
62-
- Per field in the [field settings](control-panel/field-manager/field-manager-settings.md)
63-
- Via the Dock on the front-end by toggling Edit Mode on/off.
64-
- In the template by using [ExpressionEngine template comments](#expressionengine-comment), [HTML comments](#html-comment), or [field parameter](#field-tag-parameter)
57+
There are multiple ways to enable or disable front-end editing links:
58+
- Globally with [configuration overrides](/general/system-configuration-overrides.md#enable_frontedit_links)
59+
- In the [Front-End Editing Settings](/control-panel/settings/front-end-editing.md#enable-automatic-front-end-editing-links) where you control the Dock overall.
60+
- Per field in the [field settings](control-panel/field-manager/edit-field.md)
61+
- By the user on the front-end [via the Dock](advanced-usage/front-end/dock.md#edit-toggle), by toggling Edit Mode on/off.
62+
- In the [Template Settings](control-panel/template-manager.md#settings) of an [individual template](/troubleshooting/front-end-content-management.html#dock-shows-everywhere-while-front-edit-links-only-show-some-places)
63+
- In the template by using [ExpressionEngine template comments](#expressionengine-comment), [HTML comments](#html-comment), or the [`disable` field parameter](#field-tag-parameter)
64+
- By granting or removing editing access to a user role
6565

66-
### Enable/Disable Front Edit Link in the template
66+
### Enable/Disable the Front Edit Link in the Template
6767

68-
#### ExpressionEngine Comment
68+
#### Using ExpressionEngine Comments
6969

70-
Anything content wrapped in `{!-- disable frontedit --} ... {!-- //disable frontedit --}` HTML comment will not have edit links in it.
70+
Any content wrapped in these EE comments will not have edit links in it.
7171

7272
<h1>{!-- disable frontedit --}{title}{!-- //disable frontedit --}</h1>
7373

74-
NOTE: **Hint:** If you need to disable front-end edit on large number of templates completely, you can wrap these comments around layout template.
74+
NOTE: **Hint:** If you need to disable front-end edit on large number of templates completely, wrap these comments around content using a layout template.
7575

7676

77-
#### HTML Comment
77+
#### Using HTML Comments
7878

79-
Anything content wrapped in `<!-- disable frontedit --> ... <!-- //disable frontedit -->` HTML comment will not have edit links in it.
79+
Any content wrapped in these HTML comments will not have edit links in it.
8080

8181
<h1><!-- disable frontedit -->{title}<!-- //disable frontedit --></h1>
8282

83-
NOTE: **Hint:** If you need to disable front-end edit on large number of templates completely, you can wrap these comments around layout template.
83+
NOTE: **Hint:** If you need to disable front-end edit on large number of templates completely, wrap these comments around content using a layout template.
8484

85-
#### Field tag parameter
86-
Use `disable="frontedit"` parameter on field tag to disable link for a certain field.
85+
#### Field Tag Parameter
86+
87+
Use the `disable="frontedit"` parameter on a field tag to disable the edit link for a specific field.
8788

8889
{page_content disable="frontedit"}
8990

90-
## Customizing The Link Location
91+
## Customizing the Link
9192

92-
The edit link for each field can be placed manually using [**:frontedit** modifier](#frontedit) on the field or using the [**frontedit_link**](#frontedit_link) tag if you need to have a link in a different section of a template, custom styled, or you can even place a link for a field that is currently not on the page.
93+
The edit link icon for each field can be output in another part of the HTML by using [**:frontedit** modifier](#frontedit) on the field tag. Or, by using the [**frontedit_link**](#frontedit_link) tag, you can have a raw link in a different section of a template which can be custom styled. You can also use this to place an edit icon or link for a field that is currently not on the page.
9394

9495
### `:frontedit`
9596

96-
Inside `{exp:channel:entries}` tag, using the field name postfixed with `:frontedit` will generate an edit link for that field within displayed entry.
97+
Inside `{exp:channel:entries}` tag, using a field name postfixed with `:frontedit` will generate an edit link icon for that field, regardless of that field's usual setting.
9798

98-
You may find it useful if `disable_frontedit_links` configuration override is set and you need to place the links individually.
99+
This is additionally useful if `disable_frontedit_links` configuration override is set and you need to place the links individually.
99100

100101
Example usage:
101102

@@ -108,10 +109,10 @@ Can be used to place edit link in arbitrary place (also outside or `exp:channel:
108109
| Parameter | Description |
109110
| ---------- | ----------- |
110111
| entry_id | ID of entry to edit. Required. |
111-
| field_name | Short name of field to edit. Required, unless `field_id` is specified. |
112-
| field_id | ID of field to edit. Required, unless `field_name` is specified. |
113-
| site_id | Extra CSS class to apply to link HTML. |
114-
| class | Extra CSS class to apply to link HTML. |
112+
| field_name | Short name of field to edit. Required unless `field_id` is specified. |
113+
| field_id | ID of field to edit. Required unless `field_name` is specified. |
114+
| site_id | Required when using MSM and a field name that is not unique. |
115+
| class | Extra CSS class to apply to link. |
115116

116117
Example usage:
117118

@@ -124,8 +125,17 @@ Example usage:
124125
{frontedit_link entry_id="{entry_id}" field_name="page_content" class="extra-styles"}
125126

126127

128+
## Conditional Tags
129+
130+
### `{if frontedit}`
131+
132+
```{if frontedit} content {/if}```
133+
134+
This conditional will display content if front-end editing is enabled overall for the current user.
135+
127136
### Label Custom Front-end Edit Links
128-
When using custom links, it may be useful to label these links for the user. One way of accomplishing this is by using the special [`{if frontedit}` conditional](#if-frontedit)
137+
138+
When using custom edit links, it may be useful to label these links for the user. One way of accomplishing this is by using the special [`{if frontedit}` conditional](#if-frontedit)
129139

130140
Example:
131141

@@ -134,7 +144,8 @@ Example:
134144
```
135145

136146
## Reinitialize ExpressionEngine Pro Javascript
137-
There may be times, such as when using AJAX, that page content is loaded after ExpressionEngine Pro has been initialized on a page. When this happens edit links may not work or even render. To fix this, you need to included `EE.pro.refresh();` in your script.
147+
148+
There may be times, such as when using AJAX, that page content is loaded after ExpressionEngine Pro has already initialized on a page. When this happens, edit links may not work or even render. To fix this, you can include `EE.pro.refresh();` in your script.
138149

139150
Example usage:
140151

0 commit comments

Comments
 (0)