This is probably a very easy one (it’s 6.30 on friday so I’m running on empty), but is there a consistent way to test if a grid field is being used inside a relationship tag - somethnig simple (in my case, if video show it if else image)
IE:
{relationship_field}
{if relationship_field:grid_field_has_content}<!-- << what works here??? -->
<!-- video code here -->
{if:else}
{relationship_field:image_file_field}
{/if}
{/relationship_field}I have noticed a difference sometimes between {if my_grid} and {if mygrid != ""} - can’t say why this works/doesn’t work.
I have done similar to your solution using an embed, it works. On one site I had a relationship field referencing 5 entries in 7 different channels, and each entry had it’s own (complex) display requirements, an embed for each channel got it working and the overhead was minimal..
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.