0

I've been trying to use the sample code from Pixel and Tonic for accessing playa data in a matrix field (ee2.10, playa 4.5.2, matrix 2.6.1). They provide a very clear example which I cannot get to work. Here's their example which is exactly what I want to accomplish:


{my_matrix_field var_prefix="spkr"}
    {spkr:favorite_bands} {!-- a Playa column --}
        {albums var_prefix="albm"} {!-- a Matrix field inside the band channel --}
            {spkr:row_count}.{albm:row_count} - {albm:album_title}
        {/albums}
    {/spkr:favorite_bands}
{/my_matrix_field}

However, using this as I guide I get no results. I've had to modify the above code and instead of accessing the playa column as suggested above, I've had to resort to a playa children tag which seem less efficient. Here's my code using the above as a guide that results in no output from the playa column. I'm wondering if other's have tried using P&Ts example with or without success.


{neighborhood_plans var_prefix="npd" search:neighborhood_plan_availability="not hide"}{!-- Matrix field in neighborhood channel --}
    {neighborhood_plan var_prefix="pd"}{!-- Playa column in matrix field in neighborhood channel --}
        {pd:title}
    {/neighborhood_plan}
{/neighborhood_plans}

2
  • Have you tried a bare bones template which outputs only very simple data (like titles) following their example code? Can you post that code here? It will be much easier to troubleshoot. – Derek Hogue Dec 2 '15 at 14:18
  • I added the bare bones code to my original post. – Stephen Dec 2 '15 at 16:58
1

Looks like our Playa field tag ({neighborhood_plan}) is missing the prefix - it needs that since it's inside of your prefixed Matrix field:

{neighborhood_plans var_prefix="npd" search:neighborhood_plan_availability="not hide"}{!-- Matrix field in neighborhood channel --}
    {npd:neighborhood_plan var_prefix="pd"}{!-- Playa column in matrix field in neighborhood channel --}
        {pd:title}
    {/npd:neighborhood_plan}
{/neighborhood_plans}
1
  • That was it. Well, it was that and the status parameter in combination. At one time I had the prefix in there, but without the status, and I wrongly thought the problem was related to the playa tag. Thanks for setting me straight. – Stephen Dec 2 '15 at 22:14

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.