2
{exp:channel:entries}
    {exp:playa:parents}
        {title} returns title from the entry
    {/exp:playa:parents}
{/exp:channel:entries}

If I remove the {exp:channel:entries} tag pair, then the playa returns the correct data. However, I need info from the entry and then I want to loop through all the parents in another channel.

In this case, think of the entry as a product, and then return all the FAQs about that product. The relationship is made on the FAQ not the product.

  • Definitely should not be the case. This works for me all the time. Can you try adding a channel parameter to your playa:parents tag? – Derek Hogue Apr 11 '13 at 21:33
  • I've done it before too and thought it was strange I couldn't get the proper entries out. There is, I just simplified for the post. {exp:channel:entries channel="products" limit="1" url_title="{last_segment}"} {exp:playa:parents channel="faqs"} – Ryan Shrum Apr 11 '13 at 21:37
  • Is that your full template code? also, what is your version of EE and Playa? – Lisa Apr 12 '13 at 17:50
  • I've tried stripping it down to just that with no luck. I'm on latest of everything. I was able to get the {exp:playa:parents} tag to return the correct number of entries by adding child_id="{entry_id}" to the tag pair (still with in channel entries loop), however it is still returning the title from the channel:entries loop. {parent:title} and {child:title} return as strings not as the variable. – Ryan Shrum Apr 12 '13 at 18:12
  • Ryan - I missed your response on this a month ago! I'm so sorry. Did you still need help with this one? – Lisa May 13 '13 at 20:57
1

It sounds like, although it's not entirely clear how your relationship is defined, is that you're just coming at it from the wrong end of the relationship. If the entry is a product and the relationship is defined in this entry to FAQ pages then you need to be calling the children of this entry rather than the parent.

Parent: The entry that has the Playa field.

Child: The entry that you selected in the Playa field.

Have you tried {exp:playa:children} instead of parent?

| improve this answer | |
  • It's the opposite of how you explained it. The relationship is made in the FAQ. I'm looping through the products, then want to loop through the the parent FAQs. But to answer your question, I did try the {exp:playa:children} for shoots and ladders - no dice. – Ryan Shrum Apr 12 '13 at 14:44
  • And for the record, changing from parents to children still returns the same value; which is the channel:entries data. – Ryan Shrum Apr 12 '13 at 15:10
  • OK that clears up the relationship a bit. So if the FAQs are the parent and the Products are the children then I'd say that you need to be using {exp:channel:entries channel="faqs"} for the Channel Entries tag (the parent). Then {exp:playa:parents channel="products"} for the children? – Ian Apr 12 '13 at 15:59
  • I'm 99% sure I have the tags right just not sure why it's not returning the right data - I suppose I'll just embed a template. I should be able to loop through the products, all their data, and then have a list of the parent Playa entries. (I tried the method you suggested with out success) – Ryan Shrum Apr 12 '13 at 16:57
  • What's strange is that if I run {exp:playa:total_parents}, it returns 8 - it should return 1 according to the DB. Where parent_entry_id = this entry, it has 1 child. – Ryan Shrum Apr 12 '13 at 17: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.