Keyword

Message if the category is empty

  • Matteo Luca Petitti
  • Matteo Luca Petitti's Avatar Topic Author
  • Offline
  • New Member
More
5 years 5 months ago - 5 years 5 months ago #111214 by Matteo Luca Petitti
Matteo Luca Petitti created the topic: Message if the category is empty
Hello, I need to show a message as "no items in this category" when there aren't articles in a category.
I remember that this function is avaiable on the "category management", but i don' t find this option in the K2 component.

Joomla ver 2.5.9 - K2 ver 2.6.5

Thanks for your help!! :woohoo:

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

More
6 months 1 week ago #167047 by MarcioD
MarcioD replied the topic: Message if the category is empty
Have you found the answer to your question? I also need to post information when the category is empty.

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

More
6 months 1 week ago #167059 by Krikor Boghossian
Krikor Boghossian replied the topic: Message if the category is empty
Hello,

You will need to edit your template (or overrides a bit) getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

This is the if statement that checks if items exist -> github.com/getk2/k2/blob/master/components/com_k2/templates/default/category.php#L132

You can add an else at the bottom and add your custom code inside.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

More
6 months 1 week ago #167073 by MarcioD
MarcioD replied the topic: Message if the category is empty
Thank you very much for your answer. Works perfectly!
It works if I have a category display in the menu like this: K2 »Item listings» Categories
How to do it for displaying categories this way: K2 »Latest products from (one or more) users or categories
The changes should probably be made in this file "latest.php" only how?

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

More
6 months 5 days ago #167089 by Krikor Boghossian
Krikor Boghossian replied the topic: Message if the category is empty
Exactly, this is the file you should edit.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

Moderators: william white