6.4 KiB
Poll System - Quick Start Guide
🚀 Getting Started with Polls
The poll/voting system is now fully integrated into your article and activity admin pages!
✅ What's Integrated
-
Article Admin Page (
/admin/clanky)- Poll linker in the "Media" tab when editing an article
- Link existing polls or create new ones
- Polls auto-display at the end of published articles
-
Activity Admin Page (
/admin/aktivity)- Poll linker at the bottom of the activity edit modal
- Perfect for event feedback and engagement
- Polls auto-display at the end of event details
-
Dedicated Poll Management (
/admin/ankety)- Full poll creation and management
- Statistics and analytics
- Advanced settings and options
📝 How to Add a Poll to an Article
Method 1: While Editing an Article
- Go to
/admin/clanky - Click on an existing article to edit (or create a new one and save it first)
- Navigate to the "Média" tab
- Scroll to the bottom - you'll see "Ankety" section
- Click to expand it
- Select a poll from the dropdown or create a new one in
/admin/ankety - Click "Připojit" to link the poll
Method 2: Create Poll First, Then Link
- Go to
/admin/ankety - Click "Nová anketa"
- Fill in:
- Název: e.g., "Hráč zápasu"
- Možnosti: Add at least 2 options
- Propojení s obsahem: Enter the article ID
- Set status to "Aktivní"
- Save
📅 How to Add a Poll to an Activity/Event
While Editing an Activity
- Go to
/admin/aktivity - Click to edit an existing activity (or create and save a new one first)
- Scroll to the bottom of the modal
- Find the "Ankety" section
- Click to expand
- Select a poll or create one first in
/admin/ankety - Click "Připojit"
🎯 Common Use Cases
1. Man of the Match Poll (After Match Article)
Step 1: Publish match report article
Step 2: Go to /admin/ankety and create:
Title: "Hráč zápasu - Sparta vs Slavia"
Type: Single choice
Options:
- Jan Novák (link to player if available)
- Petr Svoboda
- Martin Dvořák
Status: Active
End Date: +24 hours from now
Step 3: In article admin → Media tab → Link the poll Result: Poll appears at end of article automatically!
2. Event Feedback Poll (After Club Event)
Step 1: Create the event activity Step 2: Create poll:
Title: "Jak se vám akce líbila?"
Options:
- Výborné! 😍
- Dobré 👍
- Průměrné 😐
- Mohlo být lepší 👎
Show Results: After end
Step 3: In activity edit modal → Link the poll Result: Poll appears when users view event details!
3. Pre-Match Prediction Poll
Step 1: Create match preview article Step 2: Create poll:
Title: "Předpověď: Kdo vyhraje?"
Start Date: Now
End Date: 30 minutes before match
Options:
- Domácí tým
- Remíza
- Hosté
Show Results: After end
Step 3: Link to article Result: Fans can vote before match starts!
🔧 The PollLinker Component
The PollLinker component is embedded in both admin pages and provides:
- ✅ View linked polls - See which polls are connected
- ✅ Link existing polls - Choose from dropdown of available polls
- ✅ Unlink polls - Remove poll connections
- ✅ Quick stats - See vote counts at a glance
- ✅ Collapsible - Keeps UI clean when not in use
Features:
- Shows poll title, status, and vote count
- Click expand to manage polls
- Only shows polls not already linked elsewhere
- One-click link/unlink functionality
📊 Where Polls Appear
For Website Visitors:
-
Article Pages (
/news/:slug)- Polls appear after article content
- Before newsletter CTA
- Fully interactive with real-time voting
-
Activity Pages (
/aktivita/:id)- Polls appear after event details
- Great for gathering feedback
-
Dedicated Polls Page (
/ankety)- All active polls in one place
- Tabbed interface (All, Active, Featured)
🎨 Poll Display Features
- Real-time results with progress bars
- Mobile responsive - works on all devices
- Dark mode support - adapts to theme
- Anonymous voting - no login required (configurable)
- Duplicate prevention - IP + session tracking
- Visual feedback - shows when you've voted
💡 Tips & Best Practices
- Create polls before publishing - Ensures they appear immediately
- Set end dates - Auto-close polls after reasonable time
- Use featured flag - Shows polls on homepage widget
- Link to players - For MOTM polls, creates rich display
- Multiple polls - You can link multiple polls to same content (max 3 shown)
- Monitor stats - Check
/admin/anketyfor analytics
🔍 Finding Content IDs
Article IDs
- Go to
/admin/clanky - Click article to edit
- Look at the ID in the interface or URL
Event IDs
- Go to
/admin/aktivity - Click event to edit
- ID is shown in the interface
⚙️ Poll Settings Explained
- Type: Single (radio), Multiple (checkbox), Rating
- Status: Draft, Active, Closed, Archived
- Allow Multiple: Enable multi-select for multiple choice
- Max Choices: Limit selections (if multiple allowed)
- Show Results:
- Always: Everyone sees results
- After Vote: Only after user votes
- After End: Only when poll closes
- Never: Admin only
- Require Auth: Force login to vote
- Allow Guest Vote: Anonymous voting enabled
- Featured: Show on homepage
🆘 Troubleshooting
Poll not showing in article?
- Save the article first (poll linker only appears for saved articles)
- Check poll status is "active"
- Verify poll dates include current time
- Refresh the page
Can't find poll to link?
- Create the poll first in
/admin/ankety - Make sure poll isn't already linked elsewhere
- Check poll status is "active"
Poll not appearing on public page?
- Poll must be status "active"
- Check start/end dates
- Clear browser cache
- Verify article/event is published
📚 Related Documentation
POLL_SYSTEM_IMPLEMENTATION.md- Complete technical documentationPOLL_INTEGRATION_GUIDE.md- Content linking details/admin/docs- Admin panel help
🎉 You're Ready!
The poll system is now seamlessly integrated into your workflow. Just edit an article or activity, scroll to the poll section, and start engaging your fans!
Need Help? Check the admin documentation at /admin/docs or refer to the detailed guides in the project root.