I have a channel called fruit. There is a custom field called 'parent' of type 'relationship' in this channel. The relationship is set to channel fruit.
When I edit my entries in this channel, I can set the field called parent to any of my other entries.
- Pear (parent is Grape)
- Lemon (parent is Banana)
- Strawberry (parent is Apple)
- Kiwi (parent is Grape)
- Mango (parent is Apple)
Based on the above, with my setting of some entries to be parents of other entries, a list would appear as...
Now I want to setup an ordered list to display this relationship dynamically so that the generated code results in...
<ul> <li>Apple <ul> <li>Strawberry</li> <li>Mango</li> </ul> </li> <li>Banana <ul> <li>Lemon</li> </ul> </li> <li>Grape <ul> <li>Pear</li> <li> Kiwi</li> </ul> </li> <li>Orange</li> </ul>
I have been reading about the new way EE handles parent-child-sibling relationships in the Docs. But I am having problems coding the above.