[TYPO3-english] TYPO3 6.2: Render category rootline when using sys_category

Bert Hiddink [BENDOO e-work solutions] hiddink at bendoo.nl
Fri Nov 14 19:37:37 CET 2014


Hello,

This is my select with gives my the desired result in PHPMYADMIN but do 
not have a clue how to build this in TS:

SELECT t1.title
AS lev1, t2.title as lev2, t3.title as lev3, t4.title as lev4
FROM sys_category AS t1
LEFT JOIN sys_category AS t2 ON t2.parent = t1.uid
LEFT JOIN sys_category AS t3 ON t3.parent = t2.uid
LEFT JOIN sys_category AS t4 ON t4.parent = t3.uid
WHERE t4.uid = 1234

Any ideas will be highly appreciated!

Regards,
Bert
On 14-11-14 09:49, Bert Hiddink [BENDOO e-work solutions] wrote:
> Hello,
>
> I noticed that if I use this on News->detail, it only gives me the
> root-category, not the complete root-line, that is, "root-cat", instead
> of "root-cat->sub-cat, sub-subcat"...
>
> Any idea what is going wrong here?
>
> Thanks in advance!
>
> Regards,
> Bert
>
> <f:if condition="{category:newsItem.firstCategory}">
>          <ul class="category-breadcrumb">
>                  <f:render section="categoryBreadcrumb"
> arguments="{category:newsItem.firstCategory}" />
>          </ul>
> </f:if>
>
> <f:section name="categoryBreadcrumb">
>          <f:if condition="{category}">
>                  <f:if condition="{category.parentCategory}">
>                          <f:render section="categoryBreadcrumb"
> arguments="{category:category.parentCategory}" />
>                  </f:if>
>                  <li>{category.title}</li>
>          </f:if>
> </f:section>
>
>
>
>
> On 13-11-14 20:33, Bert Hiddink [BENDOO e-work solutions] wrote:
>>
>> "If you want to show not only the title of a single category which is
>> related to the news item but the complete category rootline use this
>> snippets.
>>
>> <f:if condition="{category:newsItem.firstCategory}">
>>          <ul class="category-breadcrumb">
>>                  <f:render section="categoryBreadcrumb"
>> arguments="{category:newsItem.firstCategory}" />
>>          </ul>
>> </f:if>
>>
>> and
>>
>> <f:section name="categoryBreadcrumb">
>>          <f:if condition="{category}">
>>                  <f:if condition="{category.parentCategory}">
>>                          <f:render section="categoryBreadcrumb"
>> arguments="{category:category.parentCategory}" />
>>                  </f:if>
>>                  <li>{category.title}</li>
>>          </f:if>
>> </f:section>"
>



More information about the TYPO3-english mailing list