I have a Matrix field (parent) in a channel set to have exactly 4 rows. The rows feature a Playa drop-down. These will serve as promotional tiles in the page templates to cross-promote other pages in the site
In the templates I must always display 4 tiles so need to write a fallback so if only 3 are selected then 1 extra random tile is shown, if only 2 are selected then 2 extra random tiles are shown, etc.
I've got this working fine using the Search parameter, eg:
{parent search:child="not IS_EMPTY"}
DO THIS
{/parent}
However, the problem I'm experiencing is what to do if no options are selected (i.e. all Playa fields/rows are empty). Ideally would be able to do an {if no_results}
conditional but can't access from within the {parent}
loop and because using search cannot access via a {if parent:total_rows==0}
conditional.
Any thoughts?