0

This template works fine on PHP 5.3.x:

{exp:stash:set parse_tags="yes" conditionals="yes"}

{stash:st_content}

  {exp:channel:entries
    channel="people"
    url_title="{segment_3}"
    dynamic="no"
    disable="categories|member_data|pagination|trackbacks"
  }
    {exp:playa:parents
      channel="projects"
      disable="member_data|pagination|trackbacks"
    }
    …
    {/exp:playa:parents}
  {/exp:channel:entries}

{/stash:st_content}

{/exp:stash:set}

but after upgrading to PHP 5.4.x, each project instead outputs the name of the people entry and no other content.

Anyone know why?

EDIT:

It seems that Stash isn't actually to blame here because if I remove Stash tags I get the same thing.

My expected output at a URL like /project/by/persons-name/ would be

  • Project A
  • Project B

etc. with only projects assigned to that person via the Playa field.

Instead, what I'm getting is

  • Person's Name
  • Person's Name

etc. for every entry in the projects channel.

The updated template with Stash taken out looks like:

{exp:channel:entries
    channel="people"
    url_title="{segment_3}"
    dynamic="no"
    disable="categories|member_data|pagination|trackbacks"
  }
    {exp:playa:parents
      channel="projects"
      disable="member_data|pagination|trackbacks"
    }
    …
    {/exp:playa:parents}
  {/exp:channel:entries}
  • Side point but that should be parse_conditionals in the {exp:stash:set} – Jeremy Daalder Mar 25 '15 at 4:17
0

This is most likely happening due to a parsing conflict between {exp:channel:entries} and {exp:playa:parent} – the former is parsing your {title} tag before Playa can get to it.

The way to solve it is with Playa’s var_prefix parameter, which allows you to alias the tags that Playa is supposed be parsing, so that other tags won’t see them.

{exp:playa:parents
  channel="projects"
  disable="member_data|pagination|trackbacks"
  var_prefix="project"
}
    {project:title}
{/exp:playa:parents}
| improve this answer | |
  • I've already tried using the var_prefix, and while that does output the correct data from the projects channel, it still outputs all projects for every person, not just the ones that have had the person assigned to it via the Playa field. – Tyssen Mar 26 '15 at 20:44
  • @Tyssen Sorry for the late reply. If you're still experiencing that, please contact support@pixelandtonic.com as it sounds like a bug. – Brandon Kelly Apr 13 '15 at 13:40

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.