Logic
Create conditional behavior in your guides by showing or hiding filters based on user selections.
Logic enables you to create conditional behavior in your guides by showing or hiding filters based on user selections. This is essential for building decision trees and personalized user experiences.
Logic Concepts
Component | Purpose | Example |
---|---|---|
Ruleset | Container for related conditions and actions | "If budget > $1000, show premium options" |
Condition | What must be true for action to trigger | User selected "High Budget" |
Action | What happens when condition is met | Show "Premium Features" filter |
Logic Use Cases
Scenario | Condition | Action | Result |
---|---|---|---|
Budget-Based Features | Budget > $500 | Show advanced features filter | Users see relevant options only |
Experience Level | User = "Beginner" | Hide technical filters | Simplified experience |
Product Categories | Category = "Electronics" | Show "Tech Specs" filter | Category-specific questions |
Location-Based | Country = "USA" | Show state selection | Relevant geographic options |
Creating Logic
Navigate to Logic Creation
Go to GuidePlugin > Logic > Create in your WordPress admin.
Configure Ruleset
Set up the basic structure:
Setting | Purpose | Options |
---|---|---|
Guides | Which guides use this logic | Select specific guides or apply to all |
Ruleset Name | Descriptive identifier | "Budget-based filtering", "Experience level logic" |
Define Conditions
Set up what triggers the logic:
Condition Structure:
- Filter/Facet - Which user selection to monitor
- Operator - How to compare (equals, contains, greater than, etc.)
- Value - What value triggers the condition
Common Condition Types:
Condition Type | Example | When to Use |
---|---|---|
Equals | Category equals "Electronics" | Exact match required |
Contains | Features contains "Premium" | Partial match sufficient |
Greater Than | Budget > 1000 | Numeric comparisons |
Less Than | Experience < 2 years | Range-based logic |
Define Actions
Specify what happens when conditions are met:
Action Types:
Action | Effect | Use Cases |
---|---|---|
Show Filter | Makes filter visible | Reveal relevant options |
Hide Filter | Makes filter invisible | Simplify user experience |
Skip Filter | Bypasses filter entirely | Streamline for specific users |
Test Logic Flow
Verify your logic works by testing different user paths through the guide.
Start Simple: Begin with basic show/hide logic before creating complex decision trees with multiple conditions.
Logic Examples
E-Commerce Product Finder
Ruleset 1: Budget-Based Features
- Condition: Budget filter equals "Premium ($500+)"
- Action: Show "Advanced Features" filter
Ruleset 2: Category-Specific Options
- Condition: Category equals "Electronics"
- Action: Show "Technical Specifications" filter
- Action: Hide "Material Type" filter
Real Estate Search
Ruleset 1: Property Type Logic
- Condition: Property Type equals "Apartment"
- Action: Show "Floor Level" filter
- Action: Hide "Lot Size" filter
Ruleset 2: Budget Qualification
- Condition: Budget > $800,000
- Action: Show "Luxury Features" filter
Service Selection Guide
Ruleset 1: Experience-Based Questions
- Condition: Experience Level equals "Beginner"
- Action: Hide "Advanced Configuration" filter
- Action: Show "Getting Started Help" filter
Advanced Logic Patterns
Multi-Condition Rules
Combine multiple conditions for complex logic:
Logic Operator | Behavior | Example |
---|---|---|
AND | All conditions must be true | Budget > $500 AND Category = "Premium" |
OR | Any condition can be true | Location = "NYC" OR Location = "LA" |
Cascading Logic
Chain logic rules for sophisticated decision trees:
Step 1: Budget Selection
↓ (if Premium)
Step 2: Premium Features
↓ (if Advanced Features selected)
Step 3: Technical Specifications
Logic Best Practices
Practice | Recommendation | Why |
---|---|---|
Keep It Simple | Start with 2-3 conditions maximum | Easier to maintain and debug |
Clear Naming | Use descriptive ruleset names | Team members can understand logic |
Test Thoroughly | Try all user paths | Prevent broken experiences |
Document Logic | Note complex decision trees | Future maintenance reference |
Troubleshooting Logic
Problem | Symptoms | Solutions |
---|---|---|
Logic Not Triggering | Filters don't show/hide as expected | Check condition syntax Verify filter/facet connections Test with exact values |
Conflicting Rules | Unexpected filter behavior | Review overlapping rulesets Check rule priority Simplify complex conditions |
Performance Issues | Slow filter transitions | Optimize complex condition sets Reduce nested logic Test with large datasets |
Logic Testing Checklist
Test Scenario | Check | Status |
---|---|---|
Default State | Verify initial filter visibility | |
Each Condition | Test every condition individually | |
Multiple Paths | Try different user selection combinations | |
Edge Cases | Test with unusual or empty selections | |
Performance | Ensure smooth transitions |
Next Steps
Once your logic is working:
Action | Purpose | Link |
---|---|---|
Apply to Guides | Implement logic in your guides | Guides Documentation → |
Test User Experience | Verify smooth user flows | Getting Started → |
Advanced Features | Explore complex decision trees | Filter Documentation → |