Skip to content

Commit 497d101

Browse files
authored
Merge pull request #748 from ExpressionEngine/feature/7.x/exp-channel-field
{exp:channel:field} tag
2 parents 45e1b9b + bccfc72 commit 497d101

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

docs/channels/fields.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!--
2+
This source file is part of the open source project
3+
ExpressionEngine User Guide (https://github.com/ExpressionEngine/ExpressionEngine-User-Guide)
4+
5+
@link https://expressionengine.com/
6+
@copyright Copyright (c) 2003-2020, Packet Tide, LLC (https://packettide.com)
7+
@license https://expressionengine.com/license Licensed under Apache License, Version 2.0
8+
-->
9+
10+
# Channel Field Tag
11+
12+
[TOC]
13+
14+
## Overview
15+
16+
`{exp:channel:field}` tag allows displaying properties of [channel field](control-panel/field-manager/edit-field.md) irrespective of the context.
17+
18+
{exp:channel:field field_name="department"}
19+
<div>
20+
<p>Choose <b>{field_label}</b>:</p>
21+
{field_options}
22+
<p><span class="value">{value}</span>: <span class="label">{label}</span></p>
23+
{/field_options}
24+
</div>
25+
{/exp:channel:field}
26+
27+
## Parameters
28+
29+
### `field_id=`
30+
31+
field_id="2"
32+
33+
Specify field ID. It is required to have either field_id or field_name parameter. If both are specified, field_id will be used.
34+
35+
### `field_name=`
36+
37+
field_name="body"
38+
39+
Specify field name. It is required to have either field_id or field_name parameter.
40+
41+
### `site_id=`
42+
43+
site_id="2"
44+
45+
By default, the tag is looking for fields that are set up for current MSM site. If you need to display properties of field that belongs to other MSM site, you need to specify site_id parameter.
46+
47+
48+
## Variables
49+
50+
[TOC=3]
51+
52+
### `{field_id}`
53+
54+
Field ID
55+
56+
### `{field_name}`
57+
58+
Field name
59+
60+
### `{field_label}`
61+
62+
Field label
63+
64+
### `{field_instructions}`
65+
66+
Field instructions for the CP
67+
68+
### `{field_type}`
69+
70+
Field type
71+
72+
### `{field_options}`
73+
74+
Tag pair that contains possible field options. It is used for fields like Radio Buttons, Checkboxes, Select Dropdown, etc.
75+
76+
Inside the tag pair you can use `{value}` and `{label}` variables:
77+
78+
{field_options}
79+
{value} / {label}
80+
{/field_options}

docs/toc_sections/_the_fundamentals_toc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@
211211
href: channels/channel-form/categories.md
212212
- name: Development
213213
href: channels/channel-form/development.md
214+
- name: Channel Field Properties
215+
href: channels/fields.md
214216

215217
#If you update fieldtypes besure to update listing on fieldtypes/overview page.
216218
- name: Fieldtypes
@@ -315,4 +317,3 @@
315317
href: comment/subscriptions.md
316318
- name: Control Panel
317319
href: comment/control-panel.md
318-

0 commit comments

Comments
 (0)