0

Parent channel: consultations Has 2 child fields: patients & doctors

I am on the patient dashboard, accessing the related consultation content using:

{exp:playa:parents entry_id="{entry_id}" channel="consultations" show_future_entries="yes" show_expired="yes"}

this is working fine. Except that I want to grab the name of the doctor assigned to this consultation, so I am trying to do this:

Physician: {cf_consult_doctor}{title}{/cf_consult_doctor}

but its not showing me anything. Can I access data like this, essentially going up from a child to the parent and then down to a different child? I tried using exp:playa:siblings but its within the exp:playa:parents tag which doesn't seem to work.

1 Answer 1

5

You can, you just need to hold Playa’s hand a little so it knows which entries all of those tags belong to. You do that with Playa’s var_prefix param:

{exp:playa:parents ... var_prefix="consultation"}
  Physician:
  {consultation:cf_consult_doctor var_prefix="doctor"}
    {doctor:title}
  {/consultation:cf_consult_doctor}
{/exp:playa:parents}
0

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.