Skip to content

Commit 594659d

Browse files
authored
Merge pull request #658 from ExpressionEngine/feature/7.x/relationship-ui-docs
Feature/7.x/relationship UI docs
2 parents 32cafa8 + 5106362 commit 594659d

File tree

2 files changed

+68
-31
lines changed

2 files changed

+68
-31
lines changed

docs/_images/relationship-ui.png

35.6 KB
Loading

docs/fieldtypes/relationships.md

Lines changed: 68 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,73 +19,100 @@ This fieldtype is currently only limited to Channels.
1919

2020
## Field Settings
2121

22-
### Channels to Relate
22+
#### Channels to Relate
2323

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.
2525

26-
### Include in Selection
26+
#### Include in Selection
2727

2828
Allow expired or future entries in this relationships field.
2929

30-
### Limit by Category
30+
#### Limit by Category
3131

3232
Choose categories to limit the entries in this relationships field.
3333

34-
### Authors
34+
#### Authors
3535

3636
Choose authors to limit the entries in this relationships field.
3737

38-
### Limit By Status
38+
#### Limit By Status
3939

4040
Choose statuses to limit the entries in this relationships field.
4141

42-
### Maximum Entries
42+
#### Maximum Entries
4343

4444
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.
4545

46-
### Order By
46+
#### Order By
4747

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.
4949

50-
### Allow Multiple Relationships?
50+
#### Allow Multiple Relationships?
5151

5252
When set to yes, authors will be allowed to create multiple relationships in a single field.
5353

54-
### Minimum selection
54+
#### Minimum selection
5555
The minimum number of relationships that can be added to the field.
5656

57-
### Maximum selection
57+
#### Maximum selection
5858
The maximum number of relationships that can be added to the field.
5959

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+
![Relationship Field UI](_images/relationship-ui.png)
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+
6085
## Template Tags
6186

6287
### Parameters
6388

6489
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:
6590

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`
82107

83108
Some relationship tags may have additional parameters available. These are included in the usage instructions below.
84109

85110
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.
86111

87112
## Accessing Children
88113

114+
[TOC=3]
115+
89116
### Usage: Multiple Related Entries
90117

91118
Given the following channel layout:
@@ -156,6 +183,8 @@ No looping occurs.
156183

157184
## Accessing Siblings
158185

186+
[TOC=3]
187+
159188
### Usage
160189

161190
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
196225

197226
In addition to the standard parameters, the following parameter may be used in this tag:
198227

199-
#### field
228+
- `field`
200229

201230
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:
202231

203232
{siblings field="relationship_field"}
204233

205234
## Accessing Parents
206235

236+
[TOC=3]
237+
207238
### Usage
208239

209240
Given the following channel layout:
@@ -244,14 +275,16 @@ The `{parents}` tag may be accessed through nested relationships tags using the
244275

245276
In addition to the standard parameters, the following parameter may be used in this tag:
246277

247-
#### field
278+
- `field`
248279

249280
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:
250281

251282
{parents field="relationship_field"}
252283

253284
## Fetching Entry IDs Only
254285

286+
[TOC=3]
287+
255288
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:
256289

257290
{relationship_field:entry_ids}
@@ -280,7 +313,7 @@ For parents:
280313

281314
The _entry_ids_ shortcut tag has only one optional parameter:
282315

283-
#### delimiter
316+
- `delimiter`
284317

285318
By default the entry IDs will be pipe-delimited, but you can choose to have them delimited with something else:
286319

@@ -333,6 +366,8 @@ Any variable available to the channel entries tag can be used inside a relations
333366

334367
## Field Examples: Children
335368

369+
[TOC=3]
370+
336371
### Checkbox and Multi Select Fields
337372

338373
For checkbox and multiselect single variables:
@@ -463,6 +498,8 @@ A file grid field variable pair:
463498

464499
## Field Examples: Parents
465500

501+
[TOC=3]
502+
466503
### Checkbox and Multi Select Fields
467504

468505
For checkbox and multiselect single variables:

0 commit comments

Comments
 (0)