cntlscrut / drupal-eca-news-workflow
Complete automated editorial workflow system for news organizations using ECA (Event Condition Action)
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:drupal-recipe
pkg:composer/cntlscrut/drupal-eca-news-workflow
Requires
- drupal/content_moderation: ^11.0
- drupal/core: ^11.0
- drupal/eca: ^2.1
- drupal/scheduler: ^3.0
- drupal/token: ^1.0
- drupal/workflows: ^11.0
Suggests
- drupal/admin_toolbar: For improved administrative interface
- drupal/google_analytics: For content performance tracking
- drupal/metatag: For SEO optimization
- drupal/pathauto: For SEO-friendly URLs
- drupal/views: For enhanced content listing and management
- drupal/views_bulk_operations: For bulk editorial operations
README
A comprehensive automated editorial workflow system built with ECA (Event Condition Action) for news organizations, magazines, and content-driven websites using Drupal.
π Features
π Editorial Workflow
- Three-State Process: Draft β In Review β Published
- Bidirectional Editing: Content can move back and forth between Draft and In Review
- Smart Transitions: Automatic validation and checks during state changes
- Bulk Operations: Manage multiple articles efficiently
- Content Scheduling: Plan publication dates and times
π§ Intelligent Notifications
- Role-Based Alerts: Targeted notifications based on user roles
- Author Updates: Real-time feedback on content status
- Editor Assignments: Automatic notification of pending reviews
- Publication Alerts: Stakeholder updates on published content
- Customizable Templates: Personalize notification messages
π Monitoring & Analytics
- Activity Logging: Complete audit trail of all editorial actions
- Performance Metrics: Track editorial efficiency
- User Analytics: Monitor team productivity
- Content Analytics: Publication success metrics
- Workflow Optimization: Data-driven process improvements
β‘ Automation Engine
- Content Validation: Automatic quality checks
- SEO Compliance: Built-in optimization checks
- Category Assignment: Smart content categorization
- Publication Automation: Scheduled publishing
- Workflow Rules: Customizable business logic
π οΈ Installation
Prerequisites
- Drupal 11.0+
- ECA module 2.1+
- Content Moderation module
- PHP 8.1+
Quick Install
# Using Drupal's recipe system drush recipe recipes/news_editorial_workflow # Or install manually drush en eca_base eca_content eca_log eca_workflow content_moderation workflows drush cim --partial --source=recipes/news_editorial_workflow/config
Composer Installation
# If installing from a repository
composer require drupal/news_editorial_workflow_recipe
drush recipe news_editorial_workflow
π Usage
1. Basic Workflow
// Content starts in Draft state $node = Node::create([ 'type' => 'news', 'title' => 'Breaking News Article', 'moderation_state' => 'draft', ]); $node->save(); // Submit for review $node->set('moderation_state', 'in_review'); $node->save(); // Triggers notification to editors // Publish content $node->set('moderation_state', 'published'); $node->save(); // Triggers publication notifications
2. Customizing Notifications
Edit the ECA model to customize notification behavior:
# In eca.eca.news_editorial_workflow.yml events: content_moderation_state_change: conditions: - workflow_id: basic_editorial - from_state: draft - to_state: in_review actions: - send_email: to: '[node:author:mail]' subject: 'Article submitted for review'
3. Adding Custom States
Extend the workflow by adding new states:
# In workflows.workflow.basic_editorial.yml type_settings: states: fact_check: label: 'Fact Check' weight: 3 transitions: fact_check_to_review: from: [fact_check] to: in_review
ποΈ Architecture
ECA Model Structure
News Editorial Workflow
βββ Content Events
β βββ State Change Triggers
β βββ User Action Events
β βββ Scheduled Events
βββ Conditions
β βββ Role Checks
β βββ Content Validation
β βββ Business Rules
βββ Actions
βββ Email Notifications
βββ User Messages
βββ Logging
βββ Content Operations
State Machine
graph LR
A[Draft] -->|Submit| B[In Review]
B -->|Approve| C[Published]
B -->|Reject| A
C -->|Unpublish| D[Unpublished]
D -->|Republish| C
Loading
π¨ Customization
Adding New Roles
- Create new role:
drush role:create fact_checker "Fact Checker" - Update ECA conditions to include new role
- Modify notification templates
Custom Email Templates
email_templates: submission_notification: subject: '[site:name] - Article Submitted: [node:title]' body: | Dear Editor, A new article has been submitted for review: Title: [node:title] Author: [node:author:display-name] Review at: [node:url]
Integration Examples
With Views Bulk Operations
# Custom VBO action for bulk state changes views_bulk_operations: actions: bulk_moderate_content: plugin_id: node_moderation_action configuration: state: published
With Scheduler Integration
# Automatic publication scheduling scheduler_integration: publish_on: '[node:field_publish_date:value]' unpublish_on: '[node:field_unpublish_date:value]'
π§ͺ Testing
Running Tests
# Unit tests phpunit --group news_editorial_workflow # Functional tests drush test-run --group EditorialWorkflow # Behat scenarios behat features/editorial-workflow.feature
Test Scenarios Included
- β Basic state transitions
- β Role-based permissions
- β Email notification delivery
- β Bulk operations
- β Content validation
- β Performance under load
π§ Configuration
Environment Variables
# Email configuration EDITORIAL_SMTP_HOST=smtp.example.com EDITORIAL_FROM_EMAIL=editorial@example.com # Notification settings EDITORIAL_ENABLE_SLACK=true EDITORIAL_SLACK_WEBHOOK=https://hooks.slack.com/...
Configuration Files
workflows.workflow.basic_editorial.yml- Workflow definitioneca.eca.news_editorial_workflow.yml- ECA configurationeca.model.news_editorial_workflow.yml- ECA model definition
π Examples
1. News Website Setup
Perfect for online newspapers with multiple reporters and editors:
drush recipe news_editorial_workflow drush role:create reporter "Reporter" drush role:create editor "Editor" drush role:create publisher "Publisher"
2. Magazine Integration
Ideal for monthly/weekly magazines with longer review cycles:
# Extended review process workflow_modifications: additional_states: - copy_edit - fact_check - legal_review
3. Corporate Blog
Streamlined workflow for corporate content:
# Simplified two-state workflow simple_workflow: states: [draft, published] auto_publish: true
π€ Contributing
We welcome contributions! Here's how to get involved:
Development Setup
git clone https://github.com/your-org/news-editorial-workflow-recipe.git
cd news-editorial-workflow-recipe
composer install
ddev start
Contribution Guidelines
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Standards
- Follow Drupal coding standards
- Write comprehensive tests
- Document all changes
- Update README as needed
π License
This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.
π Support
- Documentation: docs.example.com
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Slack: #editorial-workflow
ποΈ Credits
- Built with β€οΈ by the ECA Team
- Inspired by real-world newsroom workflows
- Community contributions from editorial professionals
πΊοΈ Roadmap
Version 1.1 (Planned)
- AI-powered content suggestions
- Advanced analytics dashboard
- Multi-site workflow synchronization
- Mobile editorial app integration
Version 1.2 (Future)
- Video/multimedia workflow support
- Social media integration
- Real-time collaborative editing
- Advanced permission granularity
Made with β€οΈ for the Drupal Community