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/fieldtypes/relationships.md
+68-31Lines changed: 68 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,73 +19,100 @@ This fieldtype is currently only limited to Channels.
19
19
20
20
## Field Settings
21
21
22
-
### Channels to Relate
22
+
####Channels to Relate
23
23
24
-
Choose which channels can related content be pulled from.
24
+
Choose which channels related content can be pulled from. When using Multiple Sites Manager, you can select channels from any site.
25
25
26
-
### Include in Selection
26
+
####Include in Selection
27
27
28
28
Allow expired or future entries in this relationships field.
29
29
30
-
### Limit by Category
30
+
####Limit by Category
31
31
32
32
Choose categories to limit the entries in this relationships field.
33
33
34
-
### Authors
34
+
####Authors
35
35
36
36
Choose authors to limit the entries in this relationships field.
37
37
38
-
### Limit By Status
38
+
####Limit By Status
39
39
40
40
Choose statuses to limit the entries in this relationships field.
41
41
42
-
### Maximum Entries
42
+
####Maximum Entries
43
43
44
44
Maximum number of entries to show in the relationship field. Leave blank to allow all entries. All entries are still available to the search, this is simply a display setting.
45
45
46
-
### Order By
46
+
####Order By
47
47
48
-
Default ordering of entries in relationship field.
48
+
Default ordering of entries in relationship field. Entries can be ordered by title or entry date.
49
49
50
-
### Allow Multiple Relationships?
50
+
####Allow Multiple Relationships?
51
51
52
52
When set to yes, authors will be allowed to create multiple relationships in a single field.
53
53
54
-
### Minimum selection
54
+
####Minimum selection
55
55
The minimum number of relationships that can be added to the field.
56
56
57
-
### Maximum selection
57
+
####Maximum selection
58
58
The maximum number of relationships that can be added to the field.
59
59
60
+
#### Display Entry IDs?
61
+
When enabled, entry IDs will be displayed together with entry title inside the field.
62
+
63
+
#### Display Status?
64
+
When enabled, colored status badge will be displayed together with entry title inside the field.
65
+
66
+
#### Defer field initialization?
67
+
When enabled, this field won’t initialize until the Edit Relationships button is clicked on. This can result in faster control panel page load times.
68
+
69
+
## Field UI
70
+
71
+
From within the field, the entries can be selected to establish relationship.
72
+
73
+
The entries can be filtered using search input and, if necessary, channel dropdown.
74
+
75
+
If the editor has corresponding permissions, they will see "New Entry" button which allows creating new channel entry without leaving the edit screen of current entry. The can also edit related entry contents without leaving the page.
76
+
77
+
If enabled in the field settings, entry ID and status will be shown to make the selection easier.
78
+
79
+
The order of selected entries can be rearranged with drag&drop.
80
+
81
+

82
+
83
+
NOTE: **Note:** The described Relationship UI is only available when using Control Panel or [Pro Front-end Content Management](advanced-usage/front-end/frontend). If you need to use this field in [Channel Form](channels/channel-form/fields.md#relationship-field) then HTML Select input will be used.
84
+
60
85
## Template Tags
61
86
62
87
### Parameters
63
88
64
89
The following parameters are available to all looping relationship tags, allowing you to further filter or sort the entries being retrieved. They function the same as they do when used on the [{exp:channel:entries}](channels/entries.md#parameters). The available parameters are:
65
90
66
-
- author_id
67
-
- backspace
68
-
- category
69
-
- channel
70
-
- entry_id
71
-
- group_id
72
-
- offset
73
-
- orderby
74
-
- show_expired
75
-
- show_future_entries
76
-
- sort
77
-
- start_on
78
-
- status
79
-
- stop_before
80
-
- url_title
81
-
- username
91
+
-`author_id`
92
+
-`backspace`
93
+
-`category`
94
+
-`channel`
95
+
-`entry_id`
96
+
-`group_id`
97
+
-`offset`
98
+
-`orderby`
99
+
-`show_expired`
100
+
-`show_future_entries`
101
+
-`sort`
102
+
-`start_on`
103
+
-`status`
104
+
-`stop_before`
105
+
-`url_title`
106
+
-`username`
82
107
83
108
Some relationship tags may have additional parameters available. These are included in the usage instructions below.
84
109
85
110
NOTE: **NOTE:** The [`disable`](fieldtypes/relationships.md#optimizing-relationships-rerformance) parameter should be applied to the containing `{exp:channel:entries}` call, not to the relationship tag itself.
86
111
87
112
## Accessing Children
88
113
114
+
[TOC=3]
115
+
89
116
### Usage: Multiple Related Entries
90
117
91
118
Given the following channel layout:
@@ -156,6 +183,8 @@ No looping occurs.
156
183
157
184
## Accessing Siblings
158
185
186
+
[TOC=3]
187
+
159
188
### Usage
160
189
161
190
Given the following channel layout:
@@ -196,14 +225,16 @@ The `{siblings}` tag does not need to be a top level tag. It may be used from a
196
225
197
226
In addition to the standard parameters, the following parameter may be used in this tag:
198
227
199
-
#### field
228
+
-`field`
200
229
201
230
There can be multiple relationship fields in a field group, thus child entries may be related to the same parent via different fields. Use the `field` parameter to specify which field in the parent entry we should be pulling the siblings from. The syntax is:
202
231
203
232
{siblings field="relationship_field"}
204
233
205
234
## Accessing Parents
206
235
236
+
[TOC=3]
237
+
207
238
### Usage
208
239
209
240
Given the following channel layout:
@@ -244,14 +275,16 @@ The `{parents}` tag may be accessed through nested relationships tags using the
244
275
245
276
In addition to the standard parameters, the following parameter may be used in this tag:
246
277
247
-
#### field
278
+
-`field`
248
279
249
280
There can be multiple relationship fields in a field group, and thus an entry may be selected as a child in multiple fields. Use the `field` parameter to specify which field in the parent entry we should be checking for our child. The syntax is:
250
281
251
282
{parents field="relationship_field"}
252
283
253
284
## Fetching Entry IDs Only
254
285
286
+
[TOC=3]
287
+
255
288
Sometimes it's useful to get just a list of the entry IDs of related entries, to pass on to a plugin as a tag a parameter or similar. If you need to do this, you can use the single variable `:entry_ids` shortcut modifier:
256
289
257
290
{relationship_field:entry_ids}
@@ -280,7 +313,7 @@ For parents:
280
313
281
314
The _entry_ids_ shortcut tag has only one optional parameter:
282
315
283
-
#### delimiter
316
+
-`delimiter`
284
317
285
318
By default the entry IDs will be pipe-delimited, but you can choose to have them delimited with something else:
286
319
@@ -333,6 +366,8 @@ Any variable available to the channel entries tag can be used inside a relations
333
366
334
367
## Field Examples: Children
335
368
369
+
[TOC=3]
370
+
336
371
### Checkbox and Multi Select Fields
337
372
338
373
For checkbox and multiselect single variables:
@@ -463,6 +498,8 @@ A file grid field variable pair:
0 commit comments