syntaxoutlaw / threadify
A Flarum extension that adds threaded discussions with visual indentation to your forum, making complex conversations easier to follow.
Fund package maintenance!
Other
Installs: 75
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Language:JavaScript
Type:flarum-extension
Requires
- flarum/core: ^1.8.0
- flarum/mentions: ^1.8.0
Requires (Dev)
- flarum/testing: ^1.8.0
This package is auto-updated.
Last update: 2025-07-30 15:55:16 UTC
README
A Flarum extension that adds threaded discussions with visual indentation to your forum, making complex conversations easier to follow.
🚀 Features
- Multi-level nested threading with distinct colors and indentation for each depth
- Pre-computed thread structure - efficient backend thread calculation and storage
- Real-time updates - new replies appear in correct threaded positions instantly
- Seamless integration - uses existing Flarum mentions
- Works on existing discussions - will also create threads for past discussions
📋 Requirements
- Flarum v1.8.10+ (tested on 1.8.10)
- Flarum Mentions Extension - Required for threading to work
- PHP 7.4+
👀 Preview:
🔧 Installation
Via Composer (when published)
composer require syntaxoutlaw/threadify
Manual Installation
- Clone/download this repository into your
extensions/threadify/
directory - Run
composer install
in the extension directory - Run
cd js && npm install && npm run build
to compile JavaScript - Enable the extension in your Flarum admin panel
🎯 How to Use
Threading works automatically using Flarum's mentions extension:
- Click Reply on any post
- Keep the @ mention that's automatically inserted (e.g.,
@"Username"#p123
) - Write your reply and submit
- Your reply will appear indented under the parent post
⚙️ How It Works
Backend (PHP)
- Database Structure:
- Adds
parent_id
column to posts table for basic parent-child relationships - Creates
threadify_threads
table for advanced thread metadata (depth, path, counts)
- Adds
- Thread Processing:
- Listens for new posts and extracts parent relationships from mention format
@"Name"#p123
- Pre-computes thread depth, path, and descendant counts for efficient frontend rendering
- Maintains thread hierarchy with proper indexing for fast queries
- Listens for new posts and extracts parent relationships from mention format
- API Endpoints:
/discussions/{id}/threads
- Returns complete thread structure with metadata/threadify/admin/rebuild-parent-ids
- Admin tool for rebuilding thread relationships
Frontend (JavaScript)
- Thread Tree Building:
- Uses pre-computed thread metadata from backend API
- Builds parent-child tree structures and flattens them to linear threaded order
- Visual Styling:
- Applies CSS classes for visual depth styling (
thread-depth-1
,thread-depth-2
, etc.) - Progressive indentation with color-coded depth indicators
- Applies CSS classes for visual depth styling (
🔍 Troubleshooting
- Threading not working? Ensure
flarum/mentions
extension is enabled - Posts not loading? Check browser console for errors and run
php flarum cache:clear
- Visual issues? Run
php flarum assets:publish
and clear browser cache - Database issues? Run
php flarum migrate
to ensure all migrations are applied
📝 License
MIT License - see LICENSE file for details.
Made with ❤️ for the Flarum community