View Single Post
  #2  
Old 02-03-2021, 05:49 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,035
 

Default Re: Showing only certain categories in the sidebar / adding a second categories box

I wouldn't count on the category id as you may add new categories or remove existing or rename existing to move them form one to the other.
I see 2 ways of doing that - using the category position or adding new property exclusively for this purpose.
If you use category position you can select categories with position less than X for the first block and the rest for the second block (or position more than X for one block and the rest for the other, whatever works best). The problem with using position is that categories are sorted by position to begin with and you will have to be very careful how you manage position so it satisfies both.
I think it is better to add another filed to the categories table for this purpose. Whatever you call it doesn't matter and it can just be boolean field - true being type and false being application. Then you can do the queries to select categories for type and application based on this field's value.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote