Skip to content

Commit b3fa972

Browse files
committed
document using field in forms
1 parent e029cc5 commit b3fa972

File tree

2 files changed

+102
-11
lines changed

2 files changed

+102
-11
lines changed

docs/member/edit-profile.md

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,37 @@
1515

1616
exp:member:edit_profile
1717

18-
Edit member profile.
18+
This template tag allows editing member's profile using the form that is similar to [Channel Form](channels/channel-form/overview.md)
1919

2020
## Parameters
2121

22+
### `include_assets=`
23+
24+
include_assets="yes"
25+
26+
Adds the Javascript and CSS that is required by custom member fields to your form. By default, these are **not** included
27+
2228
### `datepicker=`
2329

24-
Include the datepicker javascript. This should be set to ``yes`` if there is a date type member custom field in order to output the calendar.
30+
datepicker="no"
2531

26-
datepicker="yes"
32+
Adds the datepicker to your date fields. Defaults to "yes".
2733

28-
### `include_assets=`
34+
NOTE: **Note:** If you are manually constructing a date field, in order to apply the date picker you must include `rel="date-picker"`.
2935

30-
Include the CSS for the custom member fields.
36+
### `include_css=`
3137

32-
include_assets="yes"
38+
include_css="no"
39+
40+
Allows you to manage the inclusion of required CSS independently from the `include_assets` parameter. Defaults to "yes".
41+
42+
### `include_jquery=`
43+
44+
include_jquery="no"
45+
46+
Includes jQuery automatically. Defaults to "yes".
47+
48+
NOTE: **Note:** If you are using your own copy of jQuery you will need to load it **before** the form.
3349

3450
### `return=`
3551

@@ -98,6 +114,12 @@ Member username. This is a **required** field and must be unique across the site
98114
<label for="username">Username</label>
99115
<input type="text" name="username" value="{username}" maxlength="120" size="40" />
100116

117+
### Custom field
118+
119+
The custom profile fields can be displayed individually by addressing them using the field's short name prefixed with `field:`:
120+
121+
{field:birthday}
122+
101123
## Custom Profile Field Variable Pair
102124

103125
All custom fields are output inside the ``{custom_profile_fields}`` varialble tag pair.
@@ -112,20 +134,53 @@ All custom fields are output inside the ``{custom_profile_fields}`` varialble ta
112134
</p>
113135
{/custom_profile_fields}
114136

115-
## Custom Profile Field Variables
137+
### Custom Profile Field Variables
116138

117-
#### {lang:profile_field}
139+
These variables are available inside `{custom_profile_fields}` tag pair.
118140

119-
Outputs the custom field's name.
141+
#### `{lang:profile_field}`
142+
#### `{field_label}`
120143

121-
#### {lang:profile_field_description}
144+
Outputs the custom field's label.
145+
146+
#### `{field_id}`
147+
148+
Field ID
149+
150+
#### `{field_name}`
151+
152+
The field's short name
153+
154+
#### `{lang:profile_field_description}`
155+
#### `{field_instructions}`
122156

123157
Outputs the field's description, if any.
124158

125-
#### {form:custom_profile_field}
159+
#### `{form:custom_profile_field}`
160+
#### `{display_field}`
126161

127162
Shows the fully parsed custom member form field.
128163

164+
#### `{field_data}`
165+
166+
Saved field data for the member
167+
168+
#### `{if field_required}`
169+
170+
Checks whether the field is set as required
171+
172+
#### `{text_direction}`
173+
174+
Text direction set for field (`rtl` or `ltr`)
175+
176+
#### `{maxlength}`
177+
178+
Max. length set for text fields
179+
180+
#### `{field_type}`
181+
182+
Short name of the fieldtype used for field
183+
129184
## Example
130185

131186
{exp:member:edit_profile

docs/member/registration.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,34 @@ This parameter allows you to specify the primary role to assign the new member,
3838

3939
This parameter allows you to use inline errors in your registration form. The errors can be displayed using the `{error:field_name}` tag where `field_name` would need to be replaced with the name of the field that has an error, as used to compose the form.
4040

41+
### `include_assets=`
42+
43+
include_assets="yes"
44+
45+
Adds the Javascript and CSS that is required by custom member fields to your form. By default, these are **not** included
46+
47+
### `datepicker=`
48+
49+
datepicker="no"
50+
51+
Adds the datepicker to your date fields. Defaults to "yes".
52+
53+
NOTE: **Note:** If you are manually constructing a date field, in order to apply the date picker you must include `rel="date-picker"`.
54+
55+
### `include_css=`
56+
57+
include_css="no"
58+
59+
Allows you to manage the inclusion of required CSS independently from the `include_assets` parameter. Defaults to "yes".
60+
61+
### `include_jquery=`
62+
63+
include_jquery="no"
64+
65+
Includes jQuery automatically. Defaults to "yes".
66+
67+
NOTE: **Note:** If you are using your own copy of jQuery you will need to load it **before** the form.
68+
4169
## Form Inputs
4270
NOTE: Be sure to include the required JavaScript and CSS to use the native [Password Validation](member/password-validation.md).
4371

@@ -92,6 +120,11 @@ Please note you need to address those by ID and not name, e.g. `m_field_id_8`
92120
<label for="work_title">Work title</label>
93121
<input type="text" id="work_title" name="m_field_id_1" size="40" value="{if m_field_id_1}{m_field_id_1}{/if}" />
94122

123+
And easier way to display the field's input is to use special tag:
124+
125+
<label for="work_title">Work title</label>
126+
{field:work_title}
127+
95128
Custom fields can also be output inside the ``{custom_fields}`` varialble tag pair.
96129

97130
{custom_fields}
@@ -168,6 +201,9 @@ This will show errors with the submitted password as well as password confirm.
168201

169202
{if error:username}{error:username}{/if}
170203

204+
### `{field:field_name}`
205+
206+
Displays the custom field input form for the given field (substitute `field_name` with actual field name). Note that the field must be set as "visible on registration" in order to show up.
171207

172208
## Example
173209

0 commit comments

Comments
 (0)