[TYPO3-mvc] Category tree - problem double names
Dawid Pacholczyk
dpacholczyk at gmail.com
Wed Sep 14 18:27:58 CEST 2011
Poziom 1a
Poziom 2a
Poziom 3a
Poziom 2b
Poziom 2a
Poziom 3a
Poziom 3a
Poziom 2b
Poziom 1b
I`ve added one more wrap <ul><li> and now I see whole structure.
As you can see this solution is strange. He acts for every category as
for level 1. What can it be ?
My actual List.html
<f:layout name="Default" />
<f:section name="main">
<h1>Listing for Category</h1>
<ul>
<f:for each="{categories}" as="category">
<li>
{category.title}
<f:render section="categoryTree" arguments="{categories :
category.childrens}" />
</li>
</f:for>
</ul>
</f:section>
<f:section name="categoryTree">
<ul>
<f:for each="{categories}" as="category">
<li>
{category.title}
<f:if condition="{category.childrens}">
<f:render section="categoryTree" arguments="{categories :
category.childrens}" />
</f:if>
</li>
</f:for>
</ul>
</f:section>
W dniu 2011-09-14 18:07, Dawid Pacholczyk pisze:
> I forgot about <li>. It look better BUT still it doesn not work as I want
>
> Poziom 1a
> Poziom 2a
> Poziom 3a
> Poziom 2b
> Poziom 2a
> Poziom 3a
> Poziom 3a
> Poziom 2b
> Poziom 1b
>
> I have tripple "Poziom 3a", double "Poziom 2a", double "Poziom 2b"
>
> What is wrong ?
>
> Best regards,
> Dawid Pacholczyk
>
> W dniu 2011-09-14 18:01, Dawid Pacholczyk pisze:
>> Thx for the tip BUT it`s not warking too good :(
>>
>> My List.html
>>
>>
>> <f:render section="categoryTree" arguments="{categories:categories}" />
>>
>>
>> <f:section name="categoryTree">
>> <ul>
>> <f:for each="{categories}" as="category">
>> {category.title}
>> <f:if condition="{category.childrens}">
>> <f:render section="categoryTree" arguments="{categories :
>> category.childrens}" />
>> </f:if>
>> </f:for>
>> </ul>
>> </f:section>
>>
>> This what i received (Poziom = Level :) )
>>
>> Poziom 1a
>>
>> Poziom 2a
>> Poziom 3a Poziom 2b
>>
>> Poziom 2a
>>
>> Poziom 3a
>>
>> Poziom 3a Poziom 2b Poziom 1b
>>
>>
>> Still I have doubled names before next level 1 category :/
>>
>> Best regards,
>> Dawid Pacholczyk
>>
>>
>> W dniu 2011-09-14 15:50, Bastian Waidelich pisze:
>>> Dawid Pacholczyk wrote:
>>>
>>> Hi Dawid,
>>>
>>>> Hello List, I want to build simple category tree. I parent, many
>>>> childs.
>>>
>>> Try using sections then you don't need duplicate fluid snippets.
>>> see
>>> <http://git.typo3.org/FLOW3/Packages/TYPO3.git?a=blob;f=Resources/Private/Templates/TypoScriptObjects/Menu.html;h=2e1c326e80d577af6be3910ba9bb78e16cd444e0;hb=HEAD>
>>>
>>>
>>> for an example.
>>>
>>>
>>> HTH,
>>> Bastian
>>
>
More information about the TYPO3-project-typo3v4mvc
mailing list