So I have a fluid layout. The layout pulls needs to pull in relationship data from each block.
What’s the mark up for this?
{fluid_field}
{fluid_field:relationship_field}
{fluid_field:relationship_field:title}
{/fluid_field:relationship_field}
{/fluid_field}
?
And once I’ve got that working, then how do you pull in grid field data from the related entry?
Is it something like:
{fluid_field}
{fluid_field:relationship_field}
{fluid_field:relationship_field:grid_field}
{fluid_field:relationship_field:grid_field:title}
{/fluid_field:relationship_field:grid_field}
{/fluid_field:relationship_field}
{/fluid_field}
?
For reference - this appears to work:
{fluid_field}
{fluid_field:relationship_field}
{content}
{content:title}
{content:grid_field}
{content:grid_field:grid_data}
{/content:grid_field}
{/content}
{/fluid_field:relationship_field}
{/fluid_field}
Some documentation how to best use Grid / Relationship / Fluid together might be a good idea — the power they wield together is a good selling point. But the syntax is a spaghetti soup, and means a lot of trial and error.
For example you can create a fluid field, and have a grid block inside this, and inside the grid block have relationships. Which could be wonderful… But good luck figuring out that without docs… (I chose another more hacky route as I’m short of time)
Also couldn’t find my answer in the docs
I have a Fluid Field with a Grid Field in that with a Relationship field in that: This works:
{fluid_field}
{fluid_field:grid_field}
{content}
{content:grid_relationship_field}{content:grid_relationship_field:title}{/content:grid_relationship_field}
{/content}
{/fluid_field:grid_field}
{/fluid_field}
Apologies if I’ve missed it
also, not to give you more work on the examples, but should something like this work?:
{fluid_field}
{fluid_field:grid_field}
{content}
{content:grid_relationship_field}
{content:grid_relationship_field:relation_fluid_field}
{content:grid_relationship_field:relation_fluid_field:relation_grid_field}
{content:grid_relationship_field:relation_fluid_field:relation_grid_field:relation_grid_relation_field}
{content:grid_relationship_field:relation_fluid_field:relation_grid_field:relation_grid_relation_field:url_title}
{/content:grid_relationship_field:relation_fluid_field:relation_grid_field:relation_grid_relation_field}
{/content:grid_relationship_field:relation_fluid_field:relation_grid_field}
{/content:grid_relationship_field:relation_fluid_field}
{/content:grid_relationship_field}
{/content}
{/fluid_field:grid_field}
{/fluid_field}
I don’t get errors, but I don’t get anything else either.
I can’t think of a useful usecase for it though, was just interested if it would/should work?
Webmaster_Keith’s post is correct, but must have confused me when I first tried it because I couldn’t get it working.
This code works to output the relationship data if you have a Relationship Field inside a Grid Field that’s inside a Fluid Field:
{fluid_field}
{fluid_field:grid_field}
{content}
{content:relationship_field}
{content:relationship_field:title}
{/content:relationship_field}
{/content}
{/fluid_field:grid_field}
{/fluid_field}
Robin, feel free to add to the docs - might save others a bunch of time!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.