zhihe / primary-posts
Mark posts as primary content for serialized stories and multi-chapter discussions
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:flarum-extension
Requires
- flarum/core: ^1.8.0
README
A Flarum extension that allows marking posts as primary content, perfect for serialized stories, tutorials, guides, and any multi-part content.
Features
- Primary Post Marking: Mark posts as "primary content" vs comments/discussions
- Visual Indicators: Bookmark badges on primary posts for easy identification
- Smart Filtering: Toggle between "Show All" and "Primary Only" views
- Author Controls: Mark/unmark controls in post dropdown menus
- Composer Integration: Checkbox for marking posts as primary during creation
- Bilingual Support: Chinese (Simplified) and English translations
Perfect for:
- 📚 Serialized stories and episodic content
- 📖 Tutorials and educational series
- 🛠️ Development logs and progress updates
- 📝 Guides and documentation
- 🎯 Any multi-part content where you want to distinguish main content from discussions
Requirements
- Flarum 1.8.0+
- PHP 8.1+
Installation
Install with Composer:
composer require zhihe/primary-posts
Enable the extension:
php flarum extension:enable zhihe-primary-posts
Usage
For Authors
- Creating Posts: Check the "Primary" checkbox when creating discussions or replies to mark them as primary content
- Managing Posts: Use the dropdown menu (three dots) on posts to mark/unmark as primary
For Readers
- Filtering: Use the sidebar toggle button to switch between "Show All" and "Primary Only" views
- Visual Cues: Primary posts display a bookmark icon in the header
Database Schema
The extension adds two columns to the posts
table:
is_primary
: Boolean flag for primary contentprimary_number
: Sequential numbering for primary posts (future feature)
Development
Building Frontend Assets
cd js/
npm install
npm run build
File Structure
zhihe-primary-posts/
├── src/ # PHP backend code
├── js/ # JavaScript frontend code
├── locale/ # Translation files
├── migrations/ # Database migrations
├── less/ # CSS styling
├── composer.json # Package configuration
└── extend.php # Extension configuration
License
MIT License - see LICENSE file for details
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Support
- Issues: GitHub Issues
- Documentation: This README
- Discussions: Flarum Community
Making every post count 🔖✨