0

is there a way to setup categories in a way that Category1 is only shown when there are no other categories selected.

Currently it shows the category which has been selected first.

Category1 + Category2 shows Category1
Category2 + Category1 shows Category2

Thanks

EDIT:
Typo3 Version: 7.6.23
News Version: 6.1.1

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39

1 Answers1

0

anaylyzing the news template ext:news/resources/Private/Partials/List/Item.html you will find this fluid code:

<f:if condition="{newsItem.firstCategory}">
    <!-- first category -->
    <span class="news-list-category">{newsItem.firstCategory.title}</span>
</f:if>

Which will only show one category (probably the first one)

if you want all categories have a look into the detail-view (ext:news/Resources/Private/templates/News/Detail.html):

<f:if condition="{newsItem.categories}">
    <f:render partial="Category/Items" arguments="{categories:newsItem.categories, settings:settings}" />
</f:if>

copy the item partial from list view into your space (extensions) and modify the category inclusion by replacing it from the detail view.
Additionally you can add a logic to skip the Category1.

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38
  • thanks for your answer. We used a workaround. Setting the module to show any category within the parent-category and removed the unwanted category from all posts. I dont know why the person who set up that page set it up the way he did. – stm-clemens Feb 22 '19 at 09:40