howard/howard_sidebar_menu_block
Composer 安装命令:
composer require howard/howard_sidebar_menu_block
包简介
Provides a sophisticated context-aware sidebar navigation menu for Howard University sites that automatically displays relevant menu items based on the current page position in the site hierarchy.
README 文档
README
A sophisticated sidebar navigation module for Howard University's Drupal sites that provides intelligent, context-aware menu navigation based on the current page's position in the site hierarchy.
✨ Features
- 🎯 Context-Aware Navigation: Automatically determines current page position and displays relevant submenu items
- ⚡ Performance Optimized: Efficient menu tree manipulation with intelligent caching
- 🎨 Flexible Theming: Custom Twig templates with complete design control
- ♿ Accessibility Compliant: WCAG guidelines support with proper ARIA labels
- 📱 Responsive Design: Mobile-friendly navigation with responsive breakpoints
- 🔒 Security Focused: Proper access control and XSS prevention
🚀 Quick Start
Installation
Composer (Recommended):
composer require howard/howard_sidebar_menu_block drush en howard_sidebar_menu_block
Manual Installation:
- Download from GitHub releases
- Extract to
modules/contrib/howard_sidebar_menu_block - Enable:
drush en howard_sidebar_menu_block
Basic Setup
- Enable the module: Admin → Extend → Howard Sidebar Menu Block
- Place the block: Admin → Structure → Block layout → Place "Howard Sidebar Menu Block"
- Configure: Choose your sidebar region and configure visibility settings
📋 Requirements
- Drupal: 10.0+ or 11.0+
- PHP: 8.1+
- Dependencies: Block (Core), Menu (Core)
🔧 How It Works
The module intelligently analyzes your current page's position in the main menu hierarchy:
- Detects Current Position: Determines where you are in the menu structure
- Finds Parent Context: Identifies the parent menu item for contextual navigation
- Builds Relevant Tree: Constructs a menu tree showing siblings and children
- Renders Contextually: Displays only relevant navigation options
Example Behavior
Main Menu: On "About → History" page, sidebar shows:
├── Home ├── History ← (current page)
├── About ├── Leadership
│ ├── History ├── Mission
│ ├── Leadership └── Contact
│ └── Mission
├── Programs
└── Contact
📚 Documentation
Comprehensive documentation is available in the docs/ folder:
- 📖 Documentation Index - Overview of all documentation
- 🛠️ Installation Guide - Detailed setup instructions
- ⚙️ API Documentation - Technical specifications for developers
- 👩💻 Developer Guide - Customization and development
- 📝 Changelog - Version history and release notes
- 📏 Coding Standards - Code quality guidelines
- 📋 Release Checklist - Release management
🎨 Customization
Template Override
Copy templates to your theme for customization:
cp modules/contrib/howard_sidebar_menu_block/templates/* themes/your_theme/templates/
CSS Styling
Basic styling example:
.sidebar-menu { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 0.375rem; padding: 1rem; } .sidebar-menu .nav-link { display: block; padding: 0.5rem 0.75rem; color: #495057; text-decoration: none; } .sidebar-menu .nav-link:hover { background-color: #e9ecef; }
🧪 Testing
Run Tests
# Unit tests vendor/bin/phpunit modules/contrib/howard_sidebar_menu_block/tests/src/Unit/ # Functional tests vendor/bin/phpunit modules/contrib/howard_sidebar_menu_block/tests/src/Functional/
Manual Testing
- Create a multi-level menu structure
- Place the sidebar block in a region
- Navigate to different pages and verify contextual display
- Test with different user permissions
- Verify cache invalidation works correctly
🔍 Troubleshooting
Common Issues
Block not appearing:
- Check block placement and region configuration
- Verify theme has the target region
- Clear all caches:
drush cr
Wrong menu items showing:
- Verify main menu structure
- Check menu item access permissions
- Review active trail detection
Performance issues:
- Enable page caching
- Check for large menu structures (>100 items)
- Monitor memory usage
For detailed troubleshooting, see the Installation Guide.
🤝 Contributing
We welcome contributions! Please see our Developer Guide and Coding Standards.
Development Setup
git clone https://github.com/howard-university-web-services/howard_sidebar_menu_block.git composer install drush en howard_sidebar_menu_block
Code Quality
# Check coding standards vendor/bin/phpcs --standard=Drupal,DrupalPractice src/ # Run tests vendor/bin/phpunit tests/
📊 Version Information
- Current Version: 11.0.3
- Drupal Compatibility: 10.0+ | 11.0+
- Release Date: July 7, 2025
- Next Release: View Milestone
📞 Support
- 🐛 Report Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📚 Documentation: Project Docs
- 👨💻 Maintainer: Dan Rogers (Drupal.org)
📄 License
This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.
🏛️ About Howard University
This module is developed and maintained by Howard University Web Services for use across Howard University's digital properties. Howard University is a leading research university providing an educational experience of exceptional value to students of high academic standing.
🌟 Star this repository if you find it useful!
howard/howard_sidebar_menu_block 适用场景与选型建议
howard/howard_sidebar_menu_block 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 205 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「menu」 「module」 「navigation」 「drupal」 「sidebar」 「howard-university」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 howard/howard_sidebar_menu_block 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 howard/howard_sidebar_menu_block 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 howard/howard_sidebar_menu_block 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A block to display a list of links to child pages, or pages in current level
A Symfony extension to get active class base on current bundle/controller/action
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Laravel Menu management
Yii2 DynaTree Menu widget uses Dynamic tree view control jquery.dynatree.js
Yii2 module to manage website content. Kind of a CMS...
统计信息
- 总下载量: 205
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-04-10