Keyword

Hide empty categories

  • EXPORT QUALITY
  • EXPORT QUALITY's Avatar Topic Author
  • Offline
  • New Member
More
14 years 6 days ago #88778 by EXPORT QUALITY
Hide empty categories was created by EXPORT QUALITY
Hi all, i need to hide empty categories (categories with no items published) from both the category view and from the k2 tool (category list, category selection box). Is it possible?Thanks in advance, regards.

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

More
14 years 5 days ago #88779 by Doc Chaos
Replied by Doc Chaos on topic Hide empty categories
Not sure if this will be what you ask or not but it does seem to do what you request ...

NOTE: Because of limits here at the community I have published instructions for this at my site gWorldz please go here to read it, I apologize for any inconvenience.

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

  • EXPORT QUALITY
  • EXPORT QUALITY's Avatar Topic Author
  • Offline
  • New Member
More
14 years 5 days ago #88780 by EXPORT QUALITY
Replied by EXPORT QUALITY on topic Hide empty categories
As I wrote in your site:
This is much more than what i was asking for!
Thank you, i really appreciate what your did, keep up your great job!

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

More
13 years 11 months ago #88781 by James Anderson
Replied by James Anderson on topic Hide empty categories
This was great! thanks

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

More
13 years 10 months ago #88782 by Marc Díez
Replied by Marc Díez on topic Hide empty categories
Sadly I couldn't get it to work, I'm using K2 2.4.1, so some lines of code aren't in the exact same place as in your website's tutorial. Any idea on how to solve this?

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

  • EXPORT QUALITY
  • EXPORT QUALITY's Avatar Topic Author
  • Offline
  • New Member
More
13 years 10 months ago #88783 by EXPORT QUALITY
Replied by EXPORT QUALITY on topic Hide empty categories
Marc Díez said:Sadly I couldn't get it to work, I'm using K2 2.4.1, so some lines of code aren't in the exact same place as in your website's tutorial. Any idea on how to solve this?


I did it, lines numbers are almost the same anyway search for the expressions and you can't go wrong (but always do a backup)!

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

More
13 years 10 months ago #88784 by Marc Díez
Replied by Marc Díez on topic Hide empty categories
Hi Export, I searched for the expressions and all, added the lines Doc Chaos provided in the places required, but it didn't work for me.

I suppose I did it correctly as the website still works (it doesn't show any PHP error), but the empty categories are still being displayed, both in category pages and k2 tools modules.

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

More
13 years 10 months ago #88785 by Doc Chaos
Replied by Doc Chaos on topic Hide empty categories
If your site is live I can try looking at it and see if I can figure out what the problem might be, as for the tutorial my site is a little messed up, the code plugin I used seems to be screwing things up and editing it will be a pain ... its all inline CSS o.O ... so I will be removing it from the site when I fix things and if I find time I'll rewrite and update it.
Like EXPORT QUALITY said it should only require editing the correct expressions since the line numbers are different now.


Marc Díez said:Hi Export, I searched for the expressions and all, added the lines Doc Chaos provided in the places required, but it didn't work for me. I suppose I did it correctly as the website still works (it doesn't show any PHP error), but the empty categories are still being displayed, both in category pages and k2 tools modules.

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

More
13 years 10 months ago #88786 by Marc Díez
Replied by Marc Díez on topic Hide empty categories
The site is online but under login access. Do you want me to send you the modified category.php and helpers.php files?

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

More
13 years 5 months ago #88787 by Ray
Replied by Ray on topic Hide empty categories
Hi Doc, it seems you have taken your code down. I have a similar problem, many category listings with no items. In my case I need to redirect the listings with no items to another page. I have tried a 301 in the htaccess file and an alias redirect in sh404SEF but none have worked. The default link without SEF enabled directs to a 404 page that says "item not found". This is the default no item link;

index.php?option=com_k2&view=item&id=&Itemid=7

I was hoping your code could show me how to rewrite the links in the K2 files before it is displayed on the page allowing me to create the redirect in the php file.

Ray

 


Doc Chaos said:

Not sure if this will be what you ask or not but it does seem to do what you request ...
NOTE: Because of limits here at the community I have published instructions for this at my site gWorldz please go here to read it, I apologize for any inconvenience.

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


Powered by Kunena Forum