3

I have a channel called "videos" with a bunch of entries in it. One of the fields in this channel is a relationship to another channel called "person". The "person" channel has a field called "facts" which is a grid with one column called "fact".

When I render this template, I successfully get the name of each person as well as a node for each <Fact> in the "facts" grid.

<Videos>
{exp:channel:entries channel="videos"}
    <Video>
        <Subject>{person:title}</Subject>
        <Facts>
            {person:facts}
            <Fact></Fact>
            {/person:facts}
        </Facts>
    </Video>
{/exp:channel:entries}
</Videos>

However I can't figure out how to get the content of the grid to appear. I've tried:

<Fact>{fact}</Fact>
<Fact>{facts:fact}</Fact>
<Fact>{person:facts:fact}</Fact>

With the last two, I get an error:

Message: Undefined variable: field_ids
Filename: libraries/Grid_parser.php
Line Number: 103

I am running EE Core 2.7.2 (still evaluating it) under PHP 5.4.11.

7

Looks like you were missing the relationship tag pair for your person field. Try this:

<Videos>
{exp:channel:entries channel="videos"}
    {person}
    <Video>
        <Subject>{person:title}</Subject>
        <Facts>
            {person:facts}
            <Fact>{person:facts:fact}</Fact>
            {/person:facts}
        </Facts>
    </Video>
   {/person}
{/exp:channel:entries}
</Videos>
  • Yes, see the things I tried above -- shouldn't one of those have worked? – Josh Santangelo Nov 6 '13 at 19:26
  • Updated my answer – Siebird Nov 6 '13 at 19:31
  • Got it -- I'm learning how the scoping works. I need to read the relationship docs more clearly. – Josh Santangelo Nov 6 '13 at 19:58

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.