I have a system category tree in Typo3:
─┬─A─┬─A1
│ └─A2
│
└─B─┬─B1
┼─B2
└─B3
I want to render the children of B tree.
On each child news item I am able to get the categories in a string on every iteration
<f:for each="{news}" as="newsItem" iteration="iterator">
<!-- render partial="List/ServiceItem" -->
<div
<f:if condition="{newsItem.categories}">
data-groups="[<f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">'{category.title}'<f:if condition="{iteratorCategories.isLast}"><f:then></f:then><f:else>,</f:else></f:if></f:for>]"
</f:if>
>{newsItem.title} & other stuff</div>
</f:for>
I am using Shuffle.js to filter the list and I need all the B - tree children to create the group control I tried this:
<div class="news-list-category"> categories:
<f:for each="{categories}" as="category" iteration="iteratorCategories">
<f:if condition="{category.title} == 'B'">
{category.title}
<f:debug>{category.children}</f:debug>
<f:if condition="{category.children}">
children:
<f:for each="{category.children}"
as="subCategory"
iteration="iteratorSubCategories">
<span>{subCategory.title}</span>
</f:for>
</f:if>
</f:if>
</f:for>
</div>
category.children and category.item.children returns null
if condition="{category.title} == 'B' gets to the correct first level item
I used typo3conf/ext/news/Resources/Private/Templates/Styles/Twb/Templates/Category/List.html
as a reference as well
Should I rather do this in typoscript and pass to fluid
<f:cObject typoscriptObjectPath="lib.myTyposSubCategoryList" />
I'll go and see if I can get Typoscript to render this but would like a fluid solution
Thanks