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.

2
  • Have you tried the exp:playa:children tag in place of the fieldtype tag? Aug 14, 2013 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, 2013 at 14:05

2 Answers 2

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.

2
  • can you show what your final code looked like? I'm having the same problem. Thanks Oct 18, 2013 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} Oct 24, 2013 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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