Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions docs/channels/fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!--
This source file is part of the open source project
ExpressionEngine User Guide (https://github.com/ExpressionEngine/ExpressionEngine-User-Guide)

@link https://expressionengine.com/
@copyright Copyright (c) 2003-2020, Packet Tide, LLC (https://packettide.com)
@license https://expressionengine.com/license Licensed under Apache License, Version 2.0
-->

# Channel Field Tag

[TOC]

## Overview

`{exp:channel:field}` tag allows displaying properties of [channel field](control-panel/field-manager/edit-field.md) irrespective of the context.

{exp:channel:field field_name="department"}
<div>
<p>Choose <b>{field_label}</b>:</p>
{field_options}
<p><span class="value">{value}</span>: <span class="label">{label}</span></p>
{/field_options}
</div>
{/exp:channel:field}

## Parameters

### `field_id=`

field_id="2"

Specify field ID. It is required to have either field_id or field_name parameter. If both are specified, field_id will be used.

### `field_name=`

field_name="body"

Specify field name. It is required to have either field_id or field_name parameter.

### `site_id=`

site_id="2"

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.


## Variables

[TOC=3]

### `{field_id}`

Field ID

### `{field_name}`

Field name

### `{field_label}`

Field label

### `{field_instructions}`

Field instructions for the CP

### `{field_type}`

Field type

### `{field_options}`

Tag pair that contains possible field options. It is used for fields like Radio Buttons, Checkboxes, Select Dropdown, etc.

Inside the tag pair you can use `{value}` and `{label}` variables:

{field_options}
{value} / {label}
{/field_options}
3 changes: 2 additions & 1 deletion docs/toc_sections/_the_fundamentals_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@
href: channels/channel-form/categories.md
- name: Development
href: channels/channel-form/development.md
- name: Channel Field Properties
href: channels/fields.md

#If you update fieldtypes besure to update listing on fieldtypes/overview page.
- name: Fieldtypes
Expand Down Expand Up @@ -313,4 +315,3 @@
href: comment/subscriptions.md
- name: Control Panel
href: comment/control-panel.md