Skip to content

Commit 73b9c62

Browse files
authored
Merge pull request #866 from ExpressionEngine/feature/7.x/fluid-field-group-improvements
Fluid field group improvements
2 parents 48e512c + 125ed73 commit 73b9c62

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

docs/fieldtypes/fluid.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ For example, if you have a Fluid field `fluid_content` with a text field `fluid_
6161

6262
The prefixed tag pair is a looping tag pair. You can have more than one `fluid_text` field for the entry, it's entirely at the entry author's discretion. The author also determines the order of the field output.
6363

64-
Displaying field groups from within Fluid field is slightly different, as it requires additions `{fields}` tag pair.
65-
So given that `blog` is the short name of custom field group and `fluid_header` and `fluid_text` are fields in that group, the template might look like:
64+
Displaying field groups from within Fluid field is slightly different, as it uses a `{fields}` tag pair to loop through fields within the field group. The order of fields within the loop defaults to the same order of the fields within the field group. You may reverse this order by using `{fields order="desc"}` or specify a different order with `{fields fixed_order="field_2|field_1"}`.
65+
So given that `blog` is the short name of our custom field group and `fluid_header` and `fluid_text` are fields in that group, the template might look like:
6666

6767
{fluid_content}
6868

@@ -79,6 +79,18 @@ So given that `blog` is the short name of custom field group and `fluid_header`
7979

8080
{/fluid_content}
8181

82+
ExpressionEngine 7.5 introduces the ability to access fields from a field group without the use of a `{fields}` loop.
83+
The field name must be prefixed by the group's short_name and placed within the group tag like this:
84+
85+
{fluid_content}
86+
87+
{fluid_content:blog}
88+
<h3>{blog:fluid_header}</h3>
89+
<div>{blog:fluid_text}</div>
90+
{/fluid_content:blog}
91+
92+
{/fluid_content}
93+
8294
## Variables
8395

8496
TIP: **Tip:** When using any of these [tags with a parameter in a conditional](templates/conditionals.md#embedding-tags) you will have to wrap them in braces (`{}`), like so: `{if {fluid_content:first name="text_body"}}`
@@ -181,13 +193,13 @@ Additionally, the following variable are available **when using custom field gro
181193

182194
{fluid_content:count_in_group}
183195

184-
The "count" out of the fields being displayed in a field group. If five fields are in a group, then for the fourth field the `count` variable would have a value of "4".
196+
The "count" out of the fields being displayed in a field group. If five fields are in a group, then for the fourth field the `count` variable would have a value of "4".
185197

186198
### `first_in_group`
187199

188200
{fluid_content:first_in_group}
189201

190-
True, if the current field is the first one in the current field group.
202+
True, if the current field is the first one in the current field group.
191203

192204
### `index_in_group`
193205

@@ -441,7 +453,7 @@ Radio and single select fields use single variables:
441453
{/my_fluid_field:my_relationship}
442454
{/my_fluid_field}
443455

444-
### RTF Text and Textare Fields
456+
### RTF Text and Textarea Fields
445457

446458
{my_fluid_field}
447459
{my_fluid_field:my_textarea}

0 commit comments

Comments
 (0)