howard/hu_general
Composer 安装命令:
composer require howard/hu_general
包简介
Base Drupal theme for Howard University.
关键字:
README 文档
README
A comprehensive Drupal theme built specifically for Howard University websites, providing a robust and customizable foundation for university departments, schools, and organizations.
Overview
The HU General theme is designed to maintain Howard University's brand identity while providing flexibility for different departments and schools. It includes extensive customization options, responsive design, and integration with various Drupal modules commonly used in university websites.
This theme is a child of the idfive Component Library D8 Theme, inheriting standard functionality while adding Howard University-specific features and customizations.
Features
Schema.org & SEO Optimization (Enhanced in v11.1.3)
- Rich Structured Data: Comprehensive Schema.org markup for all content types with validation compliance
- Educational Institution Context: Proper academic and institutional content markup
- Enhanced Search Results: Rich snippets for articles, person profiles, and announcements
- Improved Image Handling: Optimized image processing for better Schema.org integration
- Technical SEO: Validated structured data with error prevention and enhanced preprocessing integration
- Content Type Support: Optimized markup for Articles, Pages, People, Resources, and Announcements
Theme Variants
- Default: Standard Howard University styling
- Clean & Light: Minimalist design with lighter color scheme
- Classic Editorial: Traditional academic styling optimized for content-heavy sites
Header Configuration
- Light header menu option for better contrast
- Desktop hamburger menu support for simplified navigation
- Featured header link for promotional content
- Configurable search functionality
Footer Customization
- Social media links (Twitter, Facebook, YouTube, Instagram)
- Complete address and contact information
- Institutional branding display
School/Department Branding
- Parent school/college organization display
- Department-specific branding options
- Customizable institutional hierarchy
Administrative Features
- Site-wide script injection for tracking codes
- Theme variant switcher for authenticated users
- Comprehensive caching support
Installation
Via Composer (Recommended)
composer install howard/hu_general
Manual Installation
- Extract the theme to your Drupal themes directory:
/themes/contrib/hu_general - Enable the theme in the Drupal admin interface
- Configure theme settings at:
Administration > Appearance > Settings > HU General
Updates
composer update howard/hu_general
Configuration
Theme Settings
The theme provides extensive configuration options accessible through the Drupal admin interface at /admin/appearance/settings/hu_general:
Theme Variant Settings
- Select from available theme variants
- Enable theme variant switcher for authenticated users
Howard School/Department Settings
- Parent School/College/Organization: Add the parent school or college, for example "College of Arts and Sciences"
- Parent School/College/Organization URL: Add the URL to parent school or college, for example "http://coas.howard.edu"
- Department/Site: Add the department or site, for example "Department of English"
Howard Header Settings
- Show light header menu: Uses the light menu color scheme for the header menu
- Show hamburger in Desktop: Display hamburger menu on desktop for simplified navigation
- Featured Header Link: Show a featured link in the header with custom text and URL
- Hide Search: Hide search functionality if not needed
Howard Footer Settings
- Social Links: Configure links for Twitter, Facebook, YouTube, and Instagram
- Address Information: Set up complete address and contact information for the footer
Admin Settings
- Site-wide Scripts or Embeds: Add custom JavaScript snippets, tracking codes, or other embeds (Admin only)
Template Files
The theme includes customized templates for:
Layout Templates
html.html.twig- Base HTML structure with theme variants and admin scriptspage.html.twig- Page layout and regions with OpenID Connect integrationpage--404.html.twig- Custom 404 error page
Content Templates
node--hc-page.html.twig- Standard page contentnode--hc-article.html.twig- Article content displaynode--hc-person.html.twig- Person/faculty profilesnode--hc-resource.html.twig- Resource contentnode--hc-standard-homepage.html.twig- Homepage layout
Navigation Templates
menu--sidebar-navigation.html.twig- Sidebar navigationbreadcrumb.html.twig- Breadcrumb navigationblock--menu-block--sidebar-navigation.html.twig- Menu block template
Field Templates
file-link.html.twig- Custom file link display with media name support
View Templates
views-view.html.twig- Views displayviews-view-fields.html.twig- Individual field displayviews-view-unformatted.html.twig- Unformatted view display
PHP Functions
Theme Hooks
hu_general_preprocess_html(&$variables)
Preprocesses HTML template variables, adding theme variant and admin scripts settings.
hu_general_preprocess_page(&$variables)
Preprocesses page template variables, extending theme settings, configuring hero images, and setting up OpenID Connect integration.
hu_general_preprocess_node(&$variables)
Preprocesses node template variables, making theme path available to node templates.
hu_general_preprocess_file_link(&$variables)
Customizes file link display, using media names when available and generating absolute URLs.
hu_general_theme_suggestions_page_alter(&$suggestions, $variables, $hook)
Adds custom page template suggestions, particularly for 404 error pages.
Helper Functions
_hu_general_extend_theme_variables(&$variables)
Extends template variables with all theme settings and handles proper caching dependencies.
Dependencies
Required Modules
- Core Drupal modules (minimal requirements)
Optional Modules
- OpenID Connect: For SSO integration and login block functionality
- Block: For custom block placement
- Views: For content listing and display
Component Library
The theme includes the idfive-component-library for consistent styling and components:
- Located in
/idfive-component-library/ - Contains build tools and assets
- Provides standardized UI components
Development Workflow
From the idfive-component-library directory:
-
Setup Environment:
nvm use 10 npm install
-
Development Preview:
npm run fractal
-
Production Build:
npm run build:production
Customization
Adding Custom Styles
- Modify files in
/idfive-component-library/src/ - Run the build process to compile assets
- Custom styles are automatically loaded
Creating Custom Templates
- Copy template files to your theme directory
- Modify as needed
- Clear Drupal cache
Extending Theme Settings
- Modify
theme-settings.phpto add new form elements - Update
hu_general.themeto handle new settings - Create corresponding template variables
File Structure
hu_general/
├── composer.json # Composer dependencies
├── hu_general.info.yml # Theme information
├── hu_general.libraries.yml # Asset libraries
├── hu_general.theme # Theme hooks and functions
├── theme-settings.php # Theme settings form
├── config/ # Configuration files
│ └── install/
│ └── hu_general.settings.yml
├── templates/ # Twig templates
│ ├── block/
│ ├── fields/
│ ├── forms/
│ ├── layout/
│ ├── media/
│ ├── navigation/
│ ├── node/
│ ├── page/
│ └── views/
└── idfive-component-library/ # Component library
├── build/ # Compiled assets
├── src/ # Source files
└── fractal/ # Component documentation
Best Practices
Custom Child Themes
It is HIGHLY recommended that custom child themes not be made for Howard sites unless absolutely necessary. When creating a custom child theme, only override what is absolutely necessary in order to keep standard functionality across sites.
Theme Customization
- Use the theme settings form for configuration rather than hardcoding values
- Leverage the component library for consistent styling
- Follow Drupal coding standards for any custom code
- Test across different browsers and devices
Support
For support and questions about the HU General theme:
- Check the theme documentation
- Review the component library documentation
- Contact the Howard University web development team
Contributing
When contributing to the theme:
- Follow Drupal coding standards
- Document all functions and significant code blocks
- Test across different browsers and devices
- Update documentation as needed
Documentation
- DEVELOPER.md - Developer documentation and customization guide
- TEMPLATES.md - Complete template documentation
- SECURITY.md - Security review and best practices
Resources
License
See LICENSE file for licensing information.
howard/hu_general 适用场景与选型建议
howard/hu_general 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 638 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「drupal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 howard/hu_general 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 howard/hu_general 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 howard/hu_general 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
This module extends Drupal Migrate framework.
Installs and configures the WissKI base environment with mandatory modules.
Tiny set of PHP text utility classes.
统计信息
- 总下载量: 638
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2019-04-10