Keyword

Category Title (Counter including Subcategories)

  • Marcus
  • Marcus's Avatar Topic Author
  • Offline
  • New Member
More
9 years 3 months ago #144832 by Marcus
Hi @ all, can someone tell me how to get the summary of all items in a category including all subcategories to show it behind the category title in the brackets. in the k2 standard category template is this code
<?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?>

but this value doesn't contain the number of subcategory items.
what can i do to get the catTitleItemCounter + the subCatTitleItemCounter in summary?

best regards
marcus

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
9 years 3 months ago #144851 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Category Title (Counter including Subcategories)
Hi Marcus,

I think the category template shows the count of all items including those belong to subcategories, catTitleItemCounter and subCatTitleItemCounter are switches used to enable/disable the display of items counter, you can find the in the parameters pane on the right part of the category edit form.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

Please Log in or Create an account to join the conversation.

  • Marcus
  • Marcus's Avatar Topic Author
  • Offline
  • New Member
More
9 years 3 months ago #144961 by Marcus
Hi Mohamed, the Category Counter ist not working correctly. But i don't understand why. I send you some examples from this (not published and not finished) site:
Arbeitsgruppen:
the counter behind the title shows "0"
invitrojobs.kommzept.de/index.php/de/forschung-methoden/arbeitsgruppen
but there are subcategories with many items.
Subcategory Krankheitsforschung
in the subcategory overview (on the page Arbeitsgruppen above) the counter shows 11 items included
but when i click in the subcategory it shows 29 items
invitrojobs.kommzept.de/index.php/de/forschung-methoden/arbeitsgruppen/itemlist/category/87-krankheitsforschung
the same with the other subcategories: Tissue Engineering in the overview it counts 45 items and on the page its shows 83 items
invitrojobs.kommzept.de/index.php/de/forschung-methoden/arbeitsgruppen/itemlist/category/86-tissue-engineering
and so on ...

i can't explain this behavior. can someone of you?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 3 months ago #144974 by Krikor Boghossian
Replied by Krikor Boghossian on topic Category Title (Counter including Subcategories)
Hello Marcus,

Are you using catalog mode for any of these views?
If items from child categories are shown then the counter should include all items within that list.

Eg. the 2nd and 3rd link display correctly 29 and 83 items respectively.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum