PHPackages                             howard/howard\_special\_alerts\_feed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. howard/howard\_special\_alerts\_feed

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

howard/howard\_special\_alerts\_feed
====================================

This module is designed to provide a special alerts feed block for Howard University

11.0.3(10mo ago)0247GPL-2.0+JavaScript

Since Apr 10Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/howard-university-web-services/howard_special_alerts_feed)[ Packagist](https://packagist.org/packages/howard/howard_special_alerts_feed)[ Docs](https://github.com/howard-university-web-services/howard_special_alerts_feed)[ RSS](/packages/howard-howard-special-alerts-feed/feed)WikiDiscussions 8.x-1.x Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (29)Used By (0)

Howard Special Alerts Feed
==========================

[](#howard-special-alerts-feed)

[![License](https://camo.githubusercontent.com/6d6561501d5405ffc59c38bb7807b455bb17805f9b4c492631a8034134292966/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d322e302532422d626c75652e737667)](LICENSE)[![Drupal](https://camo.githubusercontent.com/3557da63b0992cb25b9e114bf60578bbf4a672fddc794131410d541d8a7742ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64727570616c2d313025323025374325323031312d626c75652e737667)](https://www.drupal.org)

A Drupal module that provides a dynamic special alerts feed block for Howard University websites. This module fetches real-time alerts from thedig.howard.edu and displays them as dismissible notification bars across your site.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Quick Start](#quick-start)
- [Documentation](#documentation)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [API Reference](#api-reference)
- [Styling](#styling)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- **Real-time Alerts**: Automatically fetches current alerts from thedig.howard.edu
- **Date-based Filtering**: Only displays alerts that are currently active based on start/end dates
- **Dismissible Alerts**: Users can dismiss alerts, with preferences stored in cookies
- **Responsive Design**: Mobile-friendly alert display with responsive padding
- **Alert Levels**: Supports different alert severity levels (low, high) with distinct styling
- **CORS Support**: Handles cross-origin requests securely
- **Automatic Refresh**: Loads fresh alert data on each page load
- **Accessibility**: Screen reader friendly with proper ARIA labels

Quick Start
-----------

[](#quick-start)

1. **Install the module**:

    ```
    composer require howard/howard_special_alerts_feed
    drush en howard_special_alerts_feed
    ```
2. **Place the block**:

    - Go to **Structure** &gt; **Block Layout**
    - Find "Howard Special Alerts Feed" block
    - Place it in your desired region
3. **Verify it's working**:

    - Visit your site's frontend
    - Check for alerts in the configured region
    - Test dismissal functionality

Documentation
-------------

[](#documentation)

This README provides an overview and basic usage information. For comprehensive documentation, see:

- **[Installation Guide](docs/INSTALL.md)** - Detailed installation instructions and troubleshooting
- **[API Documentation](docs/API.md)** - Complete JavaScript and PHP API reference
- **[Developer Guide](docs/DEVELOPER.md)** - Development setup, customization, and contribution guidelines
- **[Changelog](docs/CHANGELOG.md)** - Version history and upgrade notes

### Quick Links

[](#quick-links)

- **Need help installing?** → [Installation Guide](docs/INSTALL.md)
- **Want to customize?** → [Developer Guide](docs/DEVELOPER.md)
- **Looking for API details?** → [API Documentation](docs/API.md)
- **Upgrading?** → [Changelog](docs/CHANGELOG.md)

Requirements
------------

[](#requirements)

This module requires the following:

### Drupal Requirements

[](#drupal-requirements)

- **Drupal Core**: 10.x or 11.x
- **Modules**:
    - `block` (core module)

### Server Requirements

[](#server-requirements)

- **PHP**: 7.4 or higher
- **Network**: Outbound HTTPS connections to thedig.howard.edu
- **CORS**: Properly configured CORS headers on thedig.howard.edu

### Browser Requirements

[](#browser-requirements)

- **JavaScript**: Modern JavaScript support (ES6+)
- **APIs**: Fetch API support
- **Cookies**: Cookie support for dismissal functionality

Installation
------------

[](#installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require howard/howard_special_alerts_feed
```

### Manual Installation

[](#manual-installation)

1. Download the module and place it in your `modules/custom/` directory
2. Enable the module via Drupal admin interface or Drush:

```
drush en howard_special_alerts_feed
```

### Post-Installation Steps

[](#post-installation-steps)

1. Clear caches:

    ```
    drush cr
    ```
2. Configure block permissions if needed

Configuration
-------------

[](#configuration)

### Block Configuration

[](#block-configuration)

1. Navigate to **Structure » Block Layout** (`/admin/structure/block`)
2. Find the "Howard Special Alerts Feed" block
3. Click "Place block" in your desired region
4. Configure block settings:
    - **Visibility**: Set page, role, or other visibility conditions
    - **Region**: Choose where the block appears (typically header or content)

### Block Settings

[](#block-settings)

The block provides informational text and links to help documentation. No additional configuration is typically required as the module automatically:

- Fetches alerts from thedig.howard.edu
- Filters by current date
- Handles dismissal via cookies

### URL Configuration

[](#url-configuration)

The module is configured to fetch alerts from:

```
https://thedig.howard.edu/jsonapi/node/alert

```

With automatic filtering parameters for:

- Start date ≤ current date
- End date ≥ current date
- Status = published

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

Once installed and configured, the module automatically:

1. **Fetches Alerts**: On page load, queries thedig.howard.edu for active alerts
2. **Displays Alerts**: Renders alerts as notification bars
3. **Handles Dismissal**: Allows users to dismiss alerts individually
4. **Manages Visibility**: Hides dismissed alerts using cookies

### Alert Structure

[](#alert-structure)

Each alert includes:

- **Title**: Main alert message
- **Subtitle**: Additional details (optional)
- **Link**: Either to the full alert page or custom URL
- **Level**: Alert severity (low, high)
- **Dates**: Start and end dates for visibility

### User Interaction

[](#user-interaction)

- **Viewing**: Alerts appear as prominent notification bars
- **Dismissing**: Click the X button to dismiss an alert
- **Persistence**: Dismissed alerts remain hidden until cookies expire

API Reference
-------------

[](#api-reference)

The module provides both JavaScript and PHP APIs for advanced customization.

### JavaScript API

[](#javascript-api)

The module exposes a `specialAlertsFeed` object with methods for:

- `loadEventData()` - Fetches alert data from thedig.howard.edu
- `checkAlerts(data, site)` - Processes and filters alert data
- `setAlertBars(data)` - Renders alerts to the page
- `hideAlerts()` - Hides alerts when none are active
- `setDismiss()` - Handles alert dismissal
- `setCookie(key, value, days)` - Stores dismissal preferences
- `getCookie(key)` - Retrieves dismissal preferences

### Drupal Integration

[](#drupal-integration)

The module integrates with Drupal through:

- **Block Plugin**: `SpecialAlertsFeedBlock` class
- **Hooks**: `hook_help()` and `hook_theme()`
- **Libraries**: CSS and JavaScript asset management

### Complete API Documentation

[](#complete-api-documentation)

For detailed API documentation including parameters, return values, and examples, see the [API Documentation](docs/API.md).

Styling
-------

[](#styling)

### CSS Classes

[](#css-classes)

The module provides the following CSS classes for styling:

#### Container Classes

[](#container-classes)

- `.alerts-feed-wrapper`: Main container for all alerts
- `.alerts-active`: Added to body when alerts are present
- `.no-alerts`: Added to body when no alerts are active

#### Alert Classes

[](#alert-classes)

- `.newsroom-alert`: Individual alert link
- `.newsroom-alert--low`: Low severity alert
- `.newsroom-alert--high`: High severity alert
- `.newsroom-alert-dismiss`: Dismiss button

#### State Classes

[](#state-classes)

- `.hidden`: Applied to dismissed alerts

### Responsive Design

[](#responsive-design)

The module includes responsive breakpoints:

- **Mobile** (1px - 1000px): Adjusted padding for smaller screens
- **Tablet** (1000px - 1700px): Percentage-based padding
- **Desktop** (1700px+): Maximum padding for large screens

### Customization

[](#customization)

To customize alert styling:

1. **Override CSS**: Add custom styles to your theme
2. **Template Override**: Copy the Twig template to your theme
3. **JavaScript Extension**: Extend the JavaScript object for custom behavior

Example CSS customization:

```
/* Custom alert colors */
.alerts-feed-wrapper .newsroom-alert--low {
  background: #your-color;
}

.alerts-feed-wrapper .newsroom-alert--high {
  background: #your-urgent-color;
}
```

Troubleshooting
---------------

[](#troubleshooting)

### Quick Fixes

[](#quick-fixes)

#### No Alerts Appearing

[](#no-alerts-appearing)

1. **Check Network**: Verify your server can reach thedig.howard.edu

    ```
    curl -I https://thedig.howard.edu/jsonapi/node/alert
    ```
2. **CORS Issues**: Ensure CORS headers are properly configured on thedig.howard.edu
3. **JavaScript Errors**: Check browser console for JavaScript errors
4. **Block Placement**: Verify the block is placed in a visible region

#### Alerts Not Dismissing

[](#alerts-not-dismissing)

1. **Cookie Settings**: Check if cookies are enabled in the browser
2. **JavaScript Errors**: Verify no JavaScript errors are preventing execution
3. **Event Handlers**: Ensure click handlers are properly attached

### Complete Troubleshooting Guide

[](#complete-troubleshooting-guide)

For comprehensive troubleshooting including:

- Detailed diagnostic steps
- Common installation issues
- Performance optimization
- Debug mode instructions
- Server configuration problems

See the [Installation Guide](docs/INSTALL.md#troubleshooting-installation) for complete troubleshooting documentation.

Contributing
------------

[](#contributing)

We welcome contributions to the Howard Special Alerts Feed module!

### Quick Start for Contributors

[](#quick-start-for-contributors)

1. **Fork the repository** on GitHub
2. **Create a feature branch** from the main branch
3. **Make your changes** following our coding standards
4. **Test thoroughly** across different browsers and devices
5. **Submit a pull request** with a clear description

### Development Guidelines

[](#development-guidelines)

- Follow Drupal coding standards
- Add tests for new functionality
- Update documentation for changes
- Ensure backward compatibility

### Complete Developer Guide

[](#complete-developer-guide)

For comprehensive development information including:

- **Development Environment Setup**
- **Module Architecture**
- **Coding Standards**
- **Testing Strategies**
- **Customization Examples**
- **Performance Optimization**
- **Security Best Practices**

See the [Developer Guide](docs/DEVELOPER.md) for complete development documentation.

### Reporting Issues

[](#reporting-issues)

When reporting issues, please include:

- Drupal version and module version
- Browser and version
- Steps to reproduce
- Expected vs actual behavior
- Any error messages or screenshots

Submit issues on [GitHub Issues](https://github.com/howard-university-web-services/howard_special_alerts_feed/issues).

Support
-------

[](#support)

- **Issues**: [GitHub Issues](https://github.com/howard-university-web-services/howard_special_alerts_feed/issues)
- **Source**: [GitHub Repository](https://github.com/howard-university-web-services/howard_special_alerts_feed)
- **Maintainer**: [Dan Rogers](https://www.drupal.org/u/dan_rogers)
- **Documentation**: [Complete Documentation](docs/) - See the docs folder for comprehensive guides

Changelog
---------

[](#changelog)

### Version 11.0.2

[](#version-1102)

- Comprehensive documentation suite with organized docs/ folder
- Enhanced JavaScript and CSS documentation following Drupal standards
- Improved code structure and error handling
- Added coding standards document and developer guides

For complete version history, upgrade notes, and migration information, see the [Changelog](docs/CHANGELOG.md).

License
-------

[](#license)

This project is licensed under the GPL-2.0+ License - see the [LICENSE](LICENSE) file for details.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance54

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 81.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Recently: every ~62 days

Total

27

Last Release

310d ago

Major Versions

8.2.11 → 11.0.02025-05-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/b26755984e1a3152bf53dffa104c927637b824f54c2aa817f02a5039cf22c60c?d=identicon)[danrogers](/maintainers/danrogers)

![](https://www.gravatar.com/avatar/afd055eb77f1d251a8a0eb703682f7fa5a7297a8e4c474d666f2d04a063e4046?d=identicon)[anthony.neumann](/maintainers/anthony.neumann)

![](https://www.gravatar.com/avatar/c5011af91052816028d937052528c1c83e414f1014245fb850f450bc003b3a3c?d=identicon)[HowardWebServices](/maintainers/HowardWebServices)

![](https://www.gravatar.com/avatar/ddd8e8d2b49ff3d896a086c456d8cfe199bc0490ab8f22ee7abeb24e67dc6040?d=identicon)[JhamereWilsonHU](/maintainers/JhamereWilsonHU)

---

Top Contributors

[![drogers98](https://avatars.githubusercontent.com/u/3209424?v=4)](https://github.com/drogers98 "drogers98 (31 commits)")[![michaelcraven-idfive](https://avatars.githubusercontent.com/u/56048531?v=4)](https://github.com/michaelcraven-idfive "michaelcraven-idfive (3 commits)")[![Skerins42](https://avatars.githubusercontent.com/u/105609564?v=4)](https://github.com/Skerins42 "Skerins42 (3 commits)")[![anthonyneumann](https://avatars.githubusercontent.com/u/8773154?v=4)](https://github.com/anthonyneumann "anthonyneumann (1 commits)")

---

Tags

drupalfeedalertsblockHoward University

### Embed Badge

![Health badge](/badges/howard-howard-special-alerts-feed/health.svg)

```
[![Health](https://phpackages.com/badges/howard-howard-special-alerts-feed/health.svg)](https://phpackages.com/packages/howard-howard-special-alerts-feed)
```

###  Alternatives

[tripal/tripal

Tripal is a toolkit to facilitate construction of online genomic, genetic (and other biological) websites.

709.9k9](/packages/tripal-tripal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
