Could someone please help me out with the syntax of some of the fluid variables when a grid is being used as one of the “sub-fields” within the fluid?
As an example, the index field - https://docs.expressionengine.com/latest/fieldtypes/fluid.html#index - works fine when using it within a simple field (such as text) but doesn’t seem to work at all within grid fields.
{fluid_field}
{fluid_field:text}
{fluid_field:index} {!-- works fine --}
{content}
{/fluid_field:text}
{fluid_field:grid_field}
{fluid_field:index} {!-- returns nothing --}
{content}
<h2>{content:header}</h2>
{content:copy}
{/content}
{/fluid_field:grid_field}
{/fluid_field}
We’ve attempted a few different versions of the syntax but can’t get anything to work - is this a bug or am I just missing something really obvious?
Any suggestions or advice appreciated.
Fluid fields are very handy, but you cannot mix / match across fluid field instances within a fluid field in the way that you are trying to do.
Each fluid field instance can access just the information stored in that field within the parent fluid field. Attempting to access the extra entry ({fluid_field:index}
) within the grid field template definitions won’t work because that value is not defined within the grid field instance you are looking at.
If you want to do what you are trying to do in the template snippet (access one fluid field instance from within another) the only way to do this probably is using Stash to grab the value of {fluid_field:text}
when it occurs and then recall it within the bits of the template looking at the grid fields. Or alternatively you maybe can refactor your code to work around this limitation.
HTH
Fluid fields are very handy, but you cannot mix / match across fluid field instances within a fluid field in the way that you are trying to do.
Each fluid field instance can access just the information stored in that field within the parent fluid field. Attempting to access the extra entry ({fluid_field:index}
) within the grid field template definitions won’t work because that value is not defined within the grid field instance you are looking at.
If you want to do what you are trying to do in the template snippet (access one fluid field instance from within another) the only way to do this probably is using Stash to grab the value of {fluid_field:text}
when it occurs and then recall it within the bits of the template looking at the grid fields. Or alternatively you maybe can refactor your code to work around this limitation.
HTH
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.