1

I'm an EE novice working on a big site. I have a configuration concept in my head and I want to know if it's doable. Please bear with my limited knowledge of EE lingo. I'm still learning.

So I have a channel Speaker whose channel fields include Name, Topic, Bio, etc. I have another channel Multimedia which includes many of the same kinds of channel fields: Title, Subtitle, Description, etc.

We have speakers come in regularly and give a presentation. We create their Speaker entry long before their event. After the event we produce a video and create the Multimedia entry for that event. We do multimedia for other types of events which is why we don't just have a multimedia channel field in the Speaker channel.

Is there a way for me to add a Playa channel field to Multimedia, connecting a Multimedia entry to a Speaker entry, and then populate the template with Speaker info?

Something like this (this is again, theoretical, but if you feel the need to correct my syntax, go right ahead):

{exp:channel:entries channel="Multimedia"}
  {if playa_field}
    {playa_field}
      <h1>{speaker_name}</h1>
      <h2>{speaker_topic}</h2>
      <p>{speaker_bio}</p>
    {/playa_field}
  {if:else}
    <h1>{media_title}</h1>
    <h2>{media_subtitle}</h2>
    <p>{media_desc}</p>
  {/if}
  <video src="{media_url}">Your browser doesn't support HTML5 video.</video>
{/exp:channel:entries}

(edit: removed a redundant {/if} thanks to syntax correction in comments)

1 Answer 1

1

You have it exactly right, save one syntax error - after {/playa_field}, you should go right to {if:else}, skipping the {/if}.

3
  • I can't believe I got it exactly right. I just tried it and it works! Okay so next step... can I store all those Speaker channel field values for use elsewhere in the template? Like maybe... {playa_field speaker_name="{speaker_name}" speaker_topic="{speaker_topic}" speaker_bio="{speaker_bio}" } {/playa_field} Sep 4, 2013 at 21:40
  • Hmm, not sure what you want to do there. Fieldtype tags are for getting data, not setting data. Can you elaborate? Sep 4, 2013 at 21:47
  • Nevermind. It's not a big hassle to make more than one IF statement. Sep 10, 2013 at 18:16

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.