0

I'm using a playa tag pair to display some related information. But would like to include a field from a different channel entry in the middle of the tag pair. I tried closing the play tag par before the field and then opening it up afterwards and continuing the loop, but this didn't work.

Could anyone offer any advice? Thanks

Here's my code, (the {tour_director_tour_specific_text} field is from the 'tour' channel not the playa related fields)

{exp:channel:entries channel='tour' disable="category_fields|member_data|pagination" dynamic="yes"}
                       {tour_to_tour_personnel}
                        <div class="unit1">
                            <div class="imageLeft">
                                <img src="{site_url}images/general/portrait-andrew-wilson.jpg" alt="portrait-andrew-wilson" width="100%" />
                            </div>
                            <div class="textRight">
                                <p>{tour_director_name_first} {tour_director_name_last}{if tour_director_name_qualification}, {/if}{tour_director_name_qualification}.</p> 
                                <p>{tour_director_tour_specific_text}</p>
                                <p class="cta"><a href="{site_url}tour-directors/{url_title}">full biography and other tours</a></p>
                            </div>
                        </div>
                        {/tour_to_tour_personnel}
{/exp:channel:entries}
1
  • Erbert, could you give us a few more details of what you are trying to accomplish? e.g. template code / expected outcome, etc..
    – Nutmeg
    Jul 5, 2014 at 1:08

1 Answer 1

1

I believe you have to add var_prefix to your playa field so that you can distinguish between the two channels. If you add var_prefix="tttp" then your fields will be {tttp:tour_director_name_first}. Then your previous channel should work.

2
  • If {tour_director_tour_specific_text} was from the parent tour channel and not the playa loop you would want to prefix all of the other fields and leave {tour_director_tour_specific_text} as is. All of the fields from the channel that playa is pulling the entries from would need prefixed like {tttp:tour_director_name_first} (if I understood the initial question correctly) Jul 5, 2014 at 23:18
  • Thanks Parscale and Justin. That's solved it for me. I had looked at using var_prefix, but hadn't implemented it properly. Many thanks
    – Erbert
    Jul 5, 2014 at 23:52

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.