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.
Example entries...
- Orange
- Banana
- Apple
- Pear (parent is Grape)
- 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...
- Apple
- Strawberry
- Mango
- Banana
- Lemon
- Grape
- Pear
- Kiwi
- Orange
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.
Cheers