Workspaces Directory Theme
Version: 1.0.0 Parent: Blocksy Repository: derintolu/workspaces-directory
A taxonomy-based workspace theme for the Directory Hub with dynamic menu system. Cloned from workspaces theme with enhanced flexibility for any taxonomy-driven navigation.
Key Differences from Workspaces
| Feature | Workspaces | Workspaces Directory |
|---|---|---|
| Menu System | Hardcoded | Taxonomy-agnostic |
| Menu Locations | Fixed (Lender/Agent/Partner) | Dynamic per-term |
| Routing | Hub shortcodes | Taxonomy archives |
| Customizer | Basic colors | Colors + menu taxonomy |
| Tutor LMS | Optional | Full integration |
Features
Taxonomy-Agnostic Menu System
Any taxonomy can control sidebar menu assignment:
// Default: 'workspace' taxonomy
// Override via filter:
add_filter('workspaces_directory_menu_taxonomy', function() {
return 'product_cat'; // Use WooCommerce categories
});Dynamic Menu Locations
Menu locations are registered dynamically:
| Location | Pattern |
|---|---|
| Default | sidebar_menu |
| Per-term | sidebar_{taxonomy}_{term_slug} |
| User menu | user_menu |
Sidebar State Hierarchy
Three-level priority for sidebar state:
- Per-page -
_sidebar_default_statepost meta - Per-term - Term meta setting
- Global - Customizer default
Installation
- Install and activate Blocksy theme
- Upload
workspaces-directorytheme - Activate as child theme
- Configure menu taxonomy in Customizer
- Create menus and assign to term-specific locations
Template Files
| File | Purpose |
|---|---|
workspace-sidebar-frame.php | Sidebar wrapper (467 lines) |
workspace-sidebar-content.php | Sidebar internals (701 lines) |
taxonomy-workspace.php | Workspace archives |
tutor/single-course-iframe.php | Course iframe display |
Includes
| File | Purpose |
|---|---|
taxonomy-menu-system.php | Dynamic menu registration |
customizer-colors.php | Color settings |
sidebar-state-metabox.php | Per-page sidebar control |
sidebar-insights-slider.php | Profile completion widget |
Customizer Settings
Sidebar Colors
| Setting | CSS Variable |
|---|---|
| Sidebar Background | --wd-sidebar-bg |
| Sidebar Text | --wd-sidebar-text |
| Sidebar Accent | --wd-sidebar-accent |
| Header Bar Background | --wd-header-bar-bg |
| Header Bar Text | --wd-header-bar-text |
| Border Color | --wd-border-color |
| User Popup Background | --wd-user-popup-bg |
| Profile Gradient Start | --wd-profile-gradient-start |
| Profile Gradient End | --wd-profile-gradient-end |
Menu Taxonomy
Select which taxonomy controls menu locations:
// Customizer option: workspaces_menu_taxonomy
// Default: 'workspace'Header Background
Same as Workspaces theme - image, video, or solid with overlay.
Sidebar State Metabox
Post editor metabox for per-page sidebar control:
// Post meta: _sidebar_default_state
// Values: 'open', 'collapsed', 'inherit'Learning Context
Special handling for /learning/ workspace:
- Shows Tutor LMS dashboard instead of WordPress menu
- Uses
Workspaces_Tutor_Dashboardclass - Hash-based navigation (
#section-name) - Icon mapping from Tutor to Lucide icons
Tutor Page Detection
// Returns true for:
is_singular('courses')
is_singular('lesson')
is_singular('tutor_quiz')
is_post_type_archive('courses')Profile Data Integration
Sidebar pulls user profile from frs-wp-users REST API:
GET /wp-json/frs-users/v1/profiles/user/{id}Fallback: WordPress user meta if API unavailable.
Fields Used:
first_name,last_name,emailjob_title,phone,companynmls_id,descriptionfacebook,twitter,linkedin
Theme.json
Same design tokens as Workspaces theme:
- 15 colors - Blues, neutrals, teals, status
- 10 gradients - Brand, hero, card variants
- Fluid typography - XS to 5XL
- 10-step spacing - 4px to 96px
- Shadow presets - Small to 2XL
Interactivity API
Same stores as Workspaces:
| Store | Purpose |
|---|---|
workspaces/sidebar | Toggle with localStorage |
workspaces/datetime | Live clock |
workspaces | Menu interactions |
Build Commands
npm run start # Watch mode (wp-scripts)
npm run build # Production build (wp-scripts)File Structure
workspaces-directory/
├── functions.php (997 lines)
├── workspace-sidebar-frame.php (467 lines)
├── workspace-sidebar-content.php (701 lines)
├── taxonomy-workspace.php (123 lines)
├── style.css (388 lines)
├── theme.json (533 lines)
├── includes/
│ ├── taxonomy-menu-system.php
│ ├── customizer-colors.php
│ ├── sidebar-state-metabox.php
│ └── sidebar-insights-slider.php
├── assets/
│ ├── css/tailwind.css
│ ├── js/sidebar-view.js
│ ├── js/datetime-view.js
│ └── js/customizer-preview.js
└── tutor/
└── single-course-iframe.phpHooks and Filters
Actions
| Hook | Purpose |
|---|---|
workspaces_header_background_content | Add header content |
workspaces_header_background_error | Handle background errors |
Filters
| Filter | Purpose |
|---|---|
workspaces_directory_menu_taxonomy | Override taxonomy |
hub_should_load_assets | Control asset loading |
workspaces_auto_insert_header_background | Auto-insert background |
Performance
- Lazy load images in sidebar
- Conditional asset loading
- CSS custom properties (no recompiles)
- localStorage for sidebar state
- Optimized scrollbar styling
Security
- Nonces on metabox saves
- Capability checks for editing
- Sanitized customizer inputs
- Escaped output throughout
- wp_remote_get() with timeout