1

I'm trying to get information from a Playa field within a Matrix field, and nothing is showing. It's a very simple task, and I can't see where I've made a mistake:

{model}<!--Matrix field-->
<div class="row details">
<div class="large-6 columns">
<img src="{model_image}" title="{model_title}" alt="{model_title}">
</div>
<div class="large-6 columns">
<p>{if "{model_production}"=="Yes"}In production.{if:else}Out of production.{/if}</p>
{if model_link}
<p>Best source for this model:<br>
<a href="{model_link}" title="{model_link}" target="_blank">{link_title}</a></p>{/if}
{if model_painter}<!--Playa field-->
<p>Example painted by {model_painter}{title}{/model_painter}</p>
{/if}
</div>
</div>
{/model}

Any ideas? Thanks in advance.

  • Have you tried the exp:playa:children tag in place of the fieldtype tag? – Jean St-Amand Aug 14 '13 at 13:30
  • You could try the var_prefix parameter to make sure the variables are not in conflict with each other. – Isabel Aug 14 '13 at 14:05
1

One thing you could do is eliminate the conditional around the Playa field - like the entries loop, Playa won't output anything if no results are found. So you can do something like this instead:

{model_painter}
    <p>{if count == "1"}Example painted by{/if} {title}</p>
{/model_painter}

This may not have any bearing on why you're not seeing a result from your playa field, but it would simplify your loop just slightly.

Could there be a custom status at play that would be causing the playa field in the matrix to fail to return an entry for you?

1

Thanks for your replies. The solution was to use {exp:playa:children field="model_painter" status="not closed"}

The channel I'm pulling data from is a Zoo Visitor members channel, and it requires the status="not closed" parameter.

  • can you show what your final code looked like? I'm having the same problem. Thanks – jennetcetera Oct 18 '13 at 20:33
  • Sorry - missed this quesion! {exp:playa:children field="official_models_painter" row_id="{row_id}" status="not closed"} <p><strong>Example painted by:</strong><br><a href="{site_url}players/profiles/{url_title}">{screen_name}</a></p> {/exp:playa:children} – user2265915 Oct 24 '13 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.