Skip to content

Commit 9adb438

Browse files
authored
Merge pull request #883 from ExpressionEngine/feature/7.5/inline-form-errors
Inline Form Errors
2 parents dce3e18 + f853b06 commit 9adb438

File tree

21 files changed

+528
-244
lines changed

21 files changed

+528
-244
lines changed

docs/_tips/form-validation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TIP: **Tip:** This form utilizes template [form validation and error handling](/templates/form-validation.md). Refer to the documentation for additional parameters and variables that are available to this tag.

docs/add-ons/email.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ The contact form is created similar to a standard web form, only you **do not**
5252
</p>
5353
{/exp:email:contact_form}
5454

55+
{{embed:_tips/form-validation.md}}
56+
5557
## Parameters
5658

5759
[TOC=3]
@@ -64,6 +66,12 @@ The contact form is created similar to a standard web form, only you **do not**
6466

6567
This allows you to set the character set of the email being sent. Use this if your form's template is using a character set other than iso-8859-1.
6668

69+
### `inline_errors=`
70+
71+
inline_errors="yes"
72+
73+
This parameter is for use with [form validation and error handling](/templates/form-validation.md) and determines the type of error reporting: inline or error template.
74+
6775
### `name=`
6876

6977
name="myForm"
@@ -120,6 +128,12 @@ If used with the redirect="none" parameter, the link text can be specified by ad
120128

121129
If the `redirect` parameter was set to value of `return`, then the user will be redirected immediately after submission of the form.
122130

131+
### `return_error=`
132+
133+
return_error="template_group/error"
134+
135+
This parameter is for use with [form validation and error handling](/templates/form-validation.md) and determines the template to return to if validation errors are detected.
136+
123137
### `preview=`
124138

125139
preview="about/contact-preview"
@@ -330,7 +344,7 @@ In the above example, the Template "friend" contains the Tell-a-Friend form.
330344
[TOC=3]
331345

332346
### `allow_attachments=`
333-
347+
334348
allow_attachments="yes"
335349

336350
This allows you to add a file input field to your form, make sure to give your file input field the name of `attachment`. Adding this parameter automatically gives the form the `enctype='multipart/form-data'` attribute.

docs/add-ons/pro-search/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Below is a list of radio buttons, one for each letter of the alphabet. Selecting
280280

281281
Below is a list of checkboxes based on a custom channel field of the Checkboxes type. You can select multiple options from this list. Entries will be shown that have any of the selected options checked. Uses [Low Options](https://github.com/EEHarbor/low_options) to generate field options.
282282

283-
Adding `contains_words="parameter_name"` to the Results tag will ensure that the selected items are not contained within other words, like appending `\W` to the values.
283+
Adding `contains_words="parameter_name"` to the Results tag will ensure that the selected items are not contained within other words, like appending `\W` to the values.
284284

285285
{exp:pro_search:form query="{segment_3}"}
286286
{exp:low_options:service_options}
@@ -503,7 +503,7 @@ Below are two lists of tags. You can select multiple tags per list. Entries that
503503

504504
## Other & Native
505505

506-
In addition to what all the [filters](/add-ons/pro-search/filters.md) bring to the party, you can also filter by native ExpressionEngine parameters, as well as some [little extras](/add-ons/pro-search/tags.md#results-tag).
506+
In addition to what all the [filters](/add-ons/pro-search/filters.md) bring to the party, you can also filter by native ExpressionEngine parameters, as well as some [little extras](/add-ons/pro-search/tags.md#exppro_searchresults).
507507

508508
### Orderby and sort in one go
509509

docs/add-ons/pro-search/filters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ The automatic `keywords:mode` uses operators in keywords for any/all/exact match
9595

9696
### Singulars & Plurals
9797

98-
Pro Search supports singular and plural matching of keywords [inflections](http://en.wikipedia.org/wiki/Inflection). To enable this, both the `keywords:inflect` and the `keywords:lang` parameters must be set. Pro Search supports English inflections natively and you can add support for other languages by adding inflection rules to your [Config file](/general/system_configuration_overrides.md):
98+
Pro Search supports singular and plural matching of keywords [inflections](http://en.wikipedia.org/wiki/Inflection). To enable this, both the `keywords:inflect` and the `keywords:lang` parameters must be set. Pro Search supports English inflections natively and you can add support for other languages by adding inflection rules to your [Config file](/general/system-configuration-overrides.md):
9999

100100
```
101101
$config['pro_search_inflection_rules'][lang] = array(
@@ -110,7 +110,7 @@ $config['pro_search_inflection_rules'][lang] = array(
110110

111111
### Stems
112112

113-
Pro Search supports matching of keywords by their stem [stemming](http://en.wikipedia.org/wiki/Stemming). To enable this, both the `keywords:stem` and the `keywords:lang` parameters must be set. English stemming is supported natively, using a [Porter stemmer](http://tartarus.org/martin/PorterStemmer/) class, and you can add support for other languages by adding this to your [Config file](/general/system_configuration_overrides.md):
113+
Pro Search supports matching of keywords by their stem [stemming](http://en.wikipedia.org/wiki/Stemming). To enable this, both the `keywords:stem` and the `keywords:lang` parameters must be set. English stemming is supported natively, using a [Porter stemmer](http://tartarus.org/martin/PorterStemmer/) class, and you can add support for other languages by adding this to your [Config file](/general/system-configuration-overrides.md):
114114

115115
```
116116
$config['pro_search_stemmers'][lang] = array(
@@ -154,7 +154,7 @@ You can use the Distance filter to limit results by a given maximum distance. Th
154154
NOTE: **Note:** Use two separate fields instead of a single one for better performance.
155155

156156
### Variables
157-
The Distance filter also makes this variable available in the [Results tag](/add-ons/pro-search/tags#results-tag):
157+
The Distance filter also makes this variable available in the [Results tag](/add-ons/pro-search/tags.md#exppro_searchresults):
158158

159159
#### `{pro_search_distance}`
160160
The calculated distance in the given unit for this entry.
@@ -163,7 +163,7 @@ NOTE: **Note:** Using the Distance filter will return the search results ordered
163163

164164
## Field Search
165165

166-
You can use the native `search:field_name` parameter to target specific fields. Additionally, Pro Search can target the entry’s ***title***, ***url_title***, ***status***, target [Grid](/fieldtypes/grid.md) columns, use multiple values for [numeric matching](/channel/channel_entries.md#numeric-matching) (in combination with the `gt`, `gte`, `lt` and `lte` params), and use ***starts / ends with*** matching.
166+
You can use the native `search:field_name` parameter to target specific fields. Additionally, Pro Search can target the entry’s ***title***, ***url_title***, ***status***, target [Grid](/fieldtypes/grid.md) columns, use multiple values for [numeric matching](/channels/entries.md#numeric-matching) (in combination with the `gt`, `gte`, `lt` and `lte` params), and use ***starts / ends with*** matching.
167167

168168
### Parameters
169169

docs/channels/entries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ The "count" out of the current entries being displayed. If five entries are bein
893893
<a href="{cp_edit_entry_url}">Edit Entry</a>
894894
{/if}
895895

896-
The URL of the entry form in the control panel where this entry can be edited. It is recommended you wrap this variable in an `{if logged_in}` conditional to hide your control panel's URL from regular site visitors. If you are running a membership-based site, hide it behind an appropriate `logged_in_primary_role_id` conditional or use [exp:member:has_role](/member/member-roles-tags.html#expmemberhas_role). For example, to hide this link from everyone but Super Admins:
896+
The URL of the entry form in the control panel where this entry can be edited. It is recommended you wrap this variable in an `{if logged_in}` conditional to hide your control panel's URL from regular site visitors. If you are running a membership-based site, hide it behind an appropriate `logged_in_primary_role_id` conditional or use [exp:member:has_role](/member/member-roles-tags.md#expmemberhas_role). For example, to hide this link from everyone but Super Admins:
897897

898898
{if logged_in_primary_role_id == 1}
899899
<a href="{cp_edit_entry_url}">Edit Entry</a>

docs/comment/form.md

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The comment submission form is created very similar to a standard web form, only
3535

3636
<input type="submit" name="submit" value="Submit" />
3737
<input type="submit" name="preview" value="Preview" />
38-
38+
3939
{!-- required to prevent EE from outputting form if commenting is disabled or expired --}
4040
{if comments_disabled}Comments on this entry are currently disabled.{/if}
4141
{if comments_expired}Commenting on this entry has expired.{/if}
@@ -46,6 +46,8 @@ This form should be placed on a "single-entry" type page such as a comments page
4646

4747
TIP: **Tip:** Notice the variables in the "value" form fields? These allow us to show the user's information in the form automatically if they click the "remember personal info" option.
4848

49+
{{embed:_tips/form-validation.md}}
50+
4951
## Comment Form Tag
5052

5153
### Parameters
@@ -54,28 +56,6 @@ TIP: **Tip:** Notice the variables in the "value" form fields? These allow us to
5456

5557
{{embed:_tips/form-attributes.md}}
5658

57-
#### `entry_id=`
58-
59-
entry_id="24"
60-
61-
You can hard code the comment form tag to display a comment form for a specific channel entry by its entry ID.
62-
63-
NOTE: **Note:** This parameter takes precedence over any entry specified dynamically in the URL, so when using this parameter you will want to make sure it is clear to the user which entry the displayed comment form belongs to.
64-
65-
#### `preview=`
66-
67-
preview="channel/preview"
68-
69-
This is a **required** parameter if you are using comment previews indicating which template should be used for comment previews. Like other "path" variables in ExpressionEngine you will use the Template Group/Template name. More on previewing can be found in the [Comment Previewing](#comment-previewing) section.
70-
71-
#### `url_title=`
72-
73-
url_title="my_wedding"
74-
75-
You can hard code the comment for tag to display a comment form for a specific channel entry by its URL title.
76-
77-
NOTE: **Note:** This parameter takes precedence over any entry specified dynamically in the URL, so when using this parameter you will want to make sure it is clear to the user which entry the displayed comment form belongs to.
78-
7959
#### `channel=`
8060

8161
channel="news"
@@ -86,6 +66,14 @@ If you link to your comment form page using the entry's URL Title, then you are
8666

8767
Because you can have the same URL Title in different channels, using this parameter will ensure that the comment submitted will be associated with the correct entry. Without this parameter, it is possible that the comment could be associated with an entry in a different channel that happens to have the same URL Title.
8868

69+
#### `entry_id=`
70+
71+
entry_id="24"
72+
73+
You can hard code the comment form tag to display a comment form for a specific channel entry by its entry ID.
74+
75+
NOTE: **Note:** This parameter takes precedence over any entry specified dynamically in the URL, so when using this parameter you will want to make sure it is clear to the user which entry the displayed comment form belongs to.
76+
8977
#### `form_class=`
9078

9179
form_class="news_comment_form"
@@ -98,6 +86,19 @@ With this parameter, you can specify the css class you want the form to have, en
9886

9987
With this parameter, you can specify the css id you want the form to have. The default value is 'comment_form'
10088

89+
90+
#### `inline_errors=`
91+
92+
inline_errors="yes"
93+
94+
This parameter is for use with [form validation and error handling](/templates/form-validation.md) and determines the type of error reporting: inline or error template.
95+
96+
#### `preview=`
97+
98+
preview="channel/preview"
99+
100+
This is a **required** parameter if you are using comment previews indicating which template should be used for comment previews. Like other "path" variables in ExpressionEngine you will use the Template Group/Template name. More on previewing can be found in the [Comment Previewing](#comment-previewing) section.
101+
101102
#### `return=`
102103

103104
return="template_group/template/url_title"
@@ -109,6 +110,20 @@ This parameter allows you to define where the user will be returned after submit
109110

110111
If this parameter is not defined, they will be returned to the form page.
111112

113+
#### `return_error=`
114+
115+
return_error="template_group/error"
116+
117+
This parameter is for use with [form validation and error handling](/templates/form-validation.md) and determines the template to return to if validation errors are detected.
118+
119+
#### `url_title=`
120+
121+
url_title="my_wedding"
122+
123+
You can hard code the comment for tag to display a comment form for a specific channel entry by its URL title.
124+
125+
NOTE: **Note:** This parameter takes precedence over any entry specified dynamically in the URL, so when using this parameter you will want to make sure it is clear to the user which entry the displayed comment form belongs to.
126+
112127
### Conditionals
113128

114129
[TOC=4]
@@ -227,11 +242,11 @@ A request for an edit will return a response array. In the case of an error, an
227242

228243
### Editing Permissions
229244

230-
By using the [{if editable}](/comment/entries.html#if-editable) conditional in the Comment Entries tag, you can output a link, instructions or a form if the viewing member has permission to edit the comment, and by using the {if can_moderate_comment} you can display whatever is appropriate if the viewing member has permission to moderate (close) the comment.
245+
By using the [{if editable}](/comment/entries.md#if-editable) conditional in the Comment Entries tag, you can output a link, instructions or a form if the viewing member has permission to edit the comment, and by using the {if can_moderate_comment} you can display whatever is appropriate if the viewing member has permission to moderate (close) the comment.
231246

232247
For members without administrative access, in order to edit a comment they must be logged in, the author of the comment, and the editing time limit must not have expired. If a member has a role with permission to edit the comments of any entry, that member will have edit permissions regardless of the editing time limit.
233248

234-
Comment moderators may close the comment. The edit time limit does not apply to moderators.
249+
Comment moderators may close the comment. The edit time limit does not apply to moderators.
235250

236251
Superadmins will always have {editable} and {can_moderate_comment} permissions on any comment.
237252

docs/control-panel/utilities/data-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Run this utility to convert all files stored in the database from sites previous
5959

6060
It is recommended that you make sure all installed add-ons are compatible with ExpressionEngine 7 and newer, and that you have made a backup of your database before running the utility.
6161

62-
After the update operation is completed, visit `Content & Design Settings` to disable [Compatibility Mode](control-panel/file-manager/file-manager.html#compatibility-mode) for File Manager.
62+
After the update operation is completed, visit `Content & Design Settings` to disable [Compatibility Mode](control-panel/file-manager/file-manager.md#compatibility-mode) for File Manager.
6363

6464
## Manage Statistics
6565

docs/development/addon-development-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
With custom add-ons you can add new fieldtypes, features, template tags, and much more to ExpressionEngine. Here we are going to look at different parts of an add-on, and how to define just what our add-on is going to do.
1313

14-
TIP: In this section, we're explaining the parts of an add-on. No need to memorize everything though, the [CLI](cli/intro.html) will generate all the pieces we need based on what functions we want our add-on to have.
14+
TIP: In this section, we're explaining the parts of an add-on. No need to memorize everything though, the [CLI](cli/intro.md) will generate all the pieces we need based on what functions we want our add-on to have.
1515

1616
[TOC]
1717

@@ -32,7 +32,7 @@ Here are some ideas of what you can accomplish with a custom add-on:
3232
These are just a few ideas of what you can do with custom add-ons. The possibilities are almost endless.
3333

3434
## Getting Started
35-
Getting started making an add-on is incredibly easy with the CLI. To begin making an add-on, simply use the [`make:addon` command](/cli/built-in-commands/make-addon.md) from the [CLI](/cli/intro.html).
35+
Getting started making an add-on is incredibly easy with the CLI. To begin making an add-on, simply use the [`make:addon` command](/cli/built-in-commands/make-addon.md) from the [CLI](/cli/intro.md).
3636

3737
TIP: If you are working with an existing add-on, we recommend you start with [Modernizing add-ons](development/modernizing-existing-add-ons.md)
3838

0 commit comments

Comments
 (0)