0

On the detail page of a tx_news record I want to list the related categories as a structured menu (not just as simple text). In principle what this TypoScript snippet does: https://docs.typo3.org/p/georgringer/news/main/en-us/singlehtml/Index.html#show-category-menu-with-typoscript (but instead of showing all categories only the related ones of the displayed news.)

Edit: the default output of the related categories is just plain text: "main category, sub category, sub category, ...". I would like to have list output like

main category

  • sub category
  • sub category
  • Sandro
    • 7
    • 4
    • What do you mean by "related categories"? The assigned categories are available in `{newsItem.categories}` - what you do with them in template `Detail.html` is up to you. (https://github.com/georgringer/news/blob/main/Resources/Private/Templates/News/Detail.html#L68) – Julian Hofmann Jan 07 '22 at 11:58
    • In the detail template they are just plain text like: "main category, sub category, sub category, ...". I would like to have list output like "
      • main category
        • sub category
        "
        – Sandro Jan 09 '22 at 10:17
      • So, why don't you change it in your template/partial? `partialRootPaths`: "Used to define several paths for partials, which will be tried in reversed order. The first folder where the desired partial is found, is used. The keys of the array define the order." (https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/ContentObjects/Fluidtemplate/Index.html#partialrootpaths) – Julian Hofmann Jan 09 '22 at 13:07
      • Thanks again for the answer, this is so obvious that I could slap myself... One problem remains, I can't differentiate between the parent category and the children. I tried the condition="{category.children}", but that did not work – Sandro Jan 11 '22 at 07:43
      • Each Category-object has a property `parentcategory`. If you want to have the top category, then you have to go through the corresponding number of levels. – Julian Hofmann Jan 11 '22 at 07:53

      0 Answers0