Skip to content

Commit ec67406

Browse files
committed
{exp:channel:field} tag
1 parent efdeff0 commit ec67406

File tree

2 files changed

+81
-1
lines changed

2 files changed

+81
-1
lines changed

docs/channels/fields.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
<p>Choose <b>{field_label}</b>:</p>
20+
{field_options}
21+
<p><span class="value">{value}</span>: <span class="label">{label}</span></p>
22+
{/field_options}
23+
</div>
24+
{/exp:channel:field}
25+
26+
## Parameters
27+
28+
### `field_id=`
29+
30+
field_id="2"
31+
32+
Specify field ID. It is required to have either field_id or field_name parameter. If both are specified, field_id will be used.
33+
34+
### `field_name=`
35+
36+
field_name="body"
37+
38+
Specify field name. It is required to have either field_id or field_name parameter.
39+
40+
### `site_id=`
41+
42+
site_id="2"
43+
44+
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.
45+
46+
47+
## Variables
48+
49+
[TOC=3]
50+
51+
### `{field_id}`
52+
53+
Field ID
54+
55+
### `{field_name}`
56+
57+
Field name
58+
59+
### `{field_label}`
60+
61+
Field label
62+
63+
### `{field_instructions}`
64+
65+
Field instructions for the CP
66+
67+
### `{field_type}`
68+
69+
Field type
70+
71+
### `{field_options}`
72+
73+
Tag pair that contains possible field options. It is used for fields like Radio Buttons, Checkboxes, Select Dropdown, etc.
74+
75+
Inside the tag pair you can use `{value}` and `{label}` variables:
76+
77+
{field_options}
78+
{value} / {label}
79+
{/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
@@ -313,4 +315,3 @@
313315
href: comment/subscriptions.md
314316
- name: Control Panel
315317
href: comment/control-panel.md
316-

0 commit comments

Comments
 (0)