feat: auto-category menu module for knowledge base sections #184

Closed
opened 2026-06-06 11:28:25 +00:00 by jmiller · 1 comment
Owner

Summary

Create a new admin module (mod_mokowaas_categories) that automatically renders article categories as a hierarchical menu -- no manual menu item mapping required. Ideal for help sections and knowledge bases where categories change frequently.

Problem

Currently, displaying article categories in the admin sidebar or frontend requires creating individual Joomla menu items for each category. This is tedious for knowledge base / help sections where categories are added, renamed, or reorganised often.

Proposed Solution

A Joomla module that:

  1. Auto-discovers categories from a configurable root category (e.g. Help or Knowledge Base)
  2. Configurable depth -- how many levels deep to render (1 = top-level only, 2 = with subcategories, etc.)
  3. Renders as a collapsible tree in the admin sidebar, matching the existing MokoWaaS menu styling
  4. Links each category to its Joomla category blog/list view
  5. Shows article counts (optional) per category
  6. Respects ACL -- only shows categories the current user can access
  7. Caches the tree to avoid DB queries on every page load

Module Parameters

  • root_category: Category picker, default 0 (all) -- Root category to start from
  • max_depth: Integer, default 3 -- How many levels deep to render
  • show_article_count: Yes/No, default Yes -- Show number of articles per category
  • show_empty: Yes/No, default No -- Show categories with zero articles
  • menu_item_id: Menu item picker -- Target menu item for category links
  • ordering: List (title/lft/created), default title -- Sort order
  • cache_time: Integer, default 60 -- Cache lifetime in minutes

Technical Notes

  • Uses #__categories table with extension = com_content
  • Query filters by published = 1 and respects access levels
  • Nested set tree traversal via lft/rgt columns from the root category
  • Template should use ul nesting with CSS classes matching mod_mokowaas_menu for consistent sidebar styling
  • Module position: mokowaas-sidebar (admin) or any frontend position

Files

  • src/packages/mod_mokowaas_categories/mod_mokowaas_categories.xml (manifest)
  • src/packages/mod_mokowaas_categories/tmpl/default.php (template)
  • src/packages/mod_mokowaas_categories/src/Dispatcher/Dispatcher.php (data logic)
  • src/packages/mod_mokowaas_categories/services/provider.php (DI registration)
  • src/packages/mod_mokowaas_categories/language/en-GB/mod_mokowaas_categories.ini
## Summary Create a new admin module (mod_mokowaas_categories) that automatically renders article categories as a hierarchical menu -- no manual menu item mapping required. Ideal for help sections and knowledge bases where categories change frequently. ## Problem Currently, displaying article categories in the admin sidebar or frontend requires creating individual Joomla menu items for each category. This is tedious for knowledge base / help sections where categories are added, renamed, or reorganised often. ## Proposed Solution A Joomla module that: 1. **Auto-discovers categories** from a configurable root category (e.g. Help or Knowledge Base) 2. **Configurable depth** -- how many levels deep to render (1 = top-level only, 2 = with subcategories, etc.) 3. **Renders as a collapsible tree** in the admin sidebar, matching the existing MokoWaaS menu styling 4. **Links each category** to its Joomla category blog/list view 5. **Shows article counts** (optional) per category 6. **Respects ACL** -- only shows categories the current user can access 7. **Caches the tree** to avoid DB queries on every page load ## Module Parameters - root_category: Category picker, default 0 (all) -- Root category to start from - max_depth: Integer, default 3 -- How many levels deep to render - show_article_count: Yes/No, default Yes -- Show number of articles per category - show_empty: Yes/No, default No -- Show categories with zero articles - menu_item_id: Menu item picker -- Target menu item for category links - ordering: List (title/lft/created), default title -- Sort order - cache_time: Integer, default 60 -- Cache lifetime in minutes ## Technical Notes - Uses #__categories table with extension = com_content - Query filters by published = 1 and respects access levels - Nested set tree traversal via lft/rgt columns from the root category - Template should use ul nesting with CSS classes matching mod_mokowaas_menu for consistent sidebar styling - Module position: mokowaas-sidebar (admin) or any frontend position ## Files - src/packages/mod_mokowaas_categories/mod_mokowaas_categories.xml (manifest) - src/packages/mod_mokowaas_categories/tmpl/default.php (template) - src/packages/mod_mokowaas_categories/src/Dispatcher/Dispatcher.php (data logic) - src/packages/mod_mokowaas_categories/services/provider.php (DI registration) - src/packages/mod_mokowaas_categories/language/en-GB/mod_mokowaas_categories.ini
Author
Owner

Branch created: feature/184-feat-auto-category-menu-module-for-knowl

git fetch origin
git checkout feature/184-feat-auto-category-menu-module-for-knowl
Branch created: [`feature/184-feat-auto-category-menu-module-for-knowl`](https://git.mokoconsulting.tech/MokoConsulting/MokoWaaS/src/branch/feature/184-feat-auto-category-menu-module-for-knowl) ```bash git fetch origin git checkout feature/184-feat-auto-category-menu-module-for-knowl ```
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoWaaS#184