Skip to content

Instantly share code, notes, and snippets.

@brandonkelly
Created February 2, 2014 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonkelly/8771071 to your computer and use it in GitHub Desktop.
Save brandonkelly/8771071 to your computer and use it in GitHub Desktop.
Grabbing “parent” Matrix rows, where the Matrix field has a Playa cell that is relating to a given entry.
{exp:channel:entries ... }
{exp:playa:parents field="matrix_field_name" col="playa_col_name" var_prefix="parent"}
{parent:matrix_field search:matrix_col_name="[{entry_id}]" var_prefix="row"}
{row:some_col_name}
{!-- we can even loop through all of those related entries
(which will include the top-level entry) if we want... --}
<ul>
{row:playa_col_name var_prefix="row_entry"}
<li>{row_entry:title}</li>
{/row:playa_col_name}
</ul>
{/parent:matrix_field}
{/exp:playa:parents}
{/exp:channel:entries}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment