0

Using the parents() method of Playa, is it possible to get the name or ID of the field in the parent that holds the relationship?

{exp:playa:parents entry_id="1" channel="my_channel"}
    parent field name or id = {????}
{/exp:playa:parents}

Thanks

  • Maybe you should edit your question to ask what you're really trying to achieve. You probably don't need to know the field id. – Jason Varga Jun 20 '13 at 12:54
  • Have tried to sum up in one line... – Russ Back Jun 21 '13 at 13:56
  • Yeah, but why would you need the field's id or name in the first place? Maybe there is a better way to do what you are trying to achieve. – Jason Varga Jun 21 '13 at 23:16
0

Is the {entry_id} tag what you're looking for?

{exp:playa:parents entry_id="1" channel="my_channel"} {entry_id} {/exp:playa:parents}

Within the context of {exp:playa:parents}, it will refer to the parent's id.

Edit

It's entirely not possible to get at the field_id of the parent that holds the relationship with the way EE and Playa are both architected.

| improve this answer | |
  • I think he wants the field id where the relationship was made, not the entry id. – Jason Varga Jun 19 '13 at 3:06
  • @jason-varga is right - it's the name or ID of the field in which the relationship is made. Use case is a parent entry in a Foo channel that has two Playa fields that can contain links to a Bar channel. When displaying my Bar entry I can see that there is a parent Foo entry, but I need to know which Playa field holds that relationship. – Russ Back Jun 20 '13 at 6:09

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.