Sections
Time to learn: 8 minutes
Prerequisites: Understanding of Placeholders and Conditions
Sections are conditional content blocks that can be shown or hidden based on your data. They're like optional paragraphs that appear or disappear based on rules you set.
Sections Quick Reference
What Are Sections?
Sections are parts of your document that can be conditionally included or excluded. They're marked with special syntax in your template and controlled by conditions.
Example:
- A "Discount Details" section that only appears for VIP customers
- An "Additional Notes" section that shows when there are notes
- A "Premium Features" section for premium customers
Before and After Example
See how sections work - content appears or disappears based on conditions:
Template with Section
Thank you for your order!
[[DiscountSection]]
Special Offer:
Get 15% off your next order!
Use code: SAVE15
[[/DiscountSection]]
Your total: {{finalTotal}}
[[AdditionalNotesForPreminumUsers]]
As a premium user, you have access to:
- Priority customer support
- Exclusive discounts
- Early access to new features
Thank you for being a valued premium customer!
[[/AdditionalNotesForPreminumUsers]]Generated Document (VIP Customer)
Thank you for your order!
Special Offer:
Get 15% off your next order!
Use code: SAVE15
Your total: $299.00How Sections Work
Sections use start and end markers to define the content:
[[SectionName]]
Content that might be shown or hidden
[[/SectionName]]
When Gdocify generates a document:
- It evaluates the section's condition
- If true, the section content is included
- If false, the section content is excluded
Creating Section Markers
Syntax
Sections use double square brackets:
- Start marker:
[[SectionName]] - End marker:
[[/SectionName]]
Example
[[DiscountDetails]]
This section contains discount information.
It will only appear for eligible customers.
[[/DiscountDetails]]
Setting Up Sections
-
Add section markers to your template:
[[SectionName]]
Your content here
[[/SectionName]] -
Open the Mapping Config overlay
-
Go to the Sections tab
-
Find your section (it will appear automatically)
-
Set the Action: Show or Hide
-
Configure Conditions (optional)
-
Save the configuration
Section Conditions
You can add conditions to sections, just like placeholders:
Example: VIP Discount Section
Section markers in template:
[[VipDiscount]]
Special VIP discount: 20% off!
[[/VipDiscount]]
Condition:
- Field:
customerType - Operator: Equals
- Value: "VIP"
Result: Only VIP customers see the discount section.
Try It Yourself
Build section conditions with the interactive playground below. Experiment with different conditions to see how they evaluate:
Condition Builder
Build conditions using the query builder below. Edit mock data to see how conditions evaluate with different values.
If
Define conditions to evaluate. You can use any placeholder from your document in the conditions.
Nested Sections
You can nest sections inside other sections:
[[OuterSection]]
This is the outer section.
[[InnerSection]]
This is inside the outer section.
[[/InnerSection]]
More outer section content.
[[/OuterSection]]
Nested sections are evaluated independently - each has its own condition.
Use Cases
Conditional Discounts
Show discount information only for eligible customers:
[[DiscountSection]]
**Special Offer:**
Get 15% off your next order!
Use code: SAVE15
[[/DiscountSection]]
Optional Notes
Include notes only when they exist:
[[AdditionalNotes]]
**Additional Information:**
{{notes}}
[[/AdditionalNotes]]
Premium Features
Show premium features for premium customers:
[[PremiumFeatures]]
**Premium Benefits:**
- Priority support
- Advanced features
- Exclusive access
[[/PremiumFeatures]]
Status-Based Content
Show different content based on status:
[[ApprovedStatus]]
✅ Your application has been approved!
[[/ApprovedStatus]]
[[PendingStatus]]
⏳ Your application is being reviewed.
[[/PendingStatus]]
Best Practices
Naming Sections
Use clear, descriptive names:
✅ Good:
DiscountDetailsAdditionalNotesPremiumFeatures
❌ Avoid:
Section1XTest
Organizing Content
- Keep sections focused: Each section should have a clear purpose
- Use consistent naming: Follow a naming convention
- Document your sections: Note what each section does
Testing Sections
- Test each condition: Verify sections show/hide correctly
- Test edge cases: What happens with empty values?
- Review output: Check that sections appear as expected
Common Mistakes
- Missing end marker: Every
[[SectionName]]needs a[[/SectionName]] - Typos in names:
[[SectionName]]and[[sectionname]]are different - Nested incorrectly: Make sure nested sections are properly closed
- Wrong condition: Verify conditions match your data
Tips
- Start simple: Begin with basic sections, add complexity later
- Test thoroughly: Verify sections work before generating many documents
- Use descriptive names: Makes it easier to manage sections
- Combine with placeholders: Use placeholders inside sections for dynamic content
Sections vs. Placeholder Conditions
When should you use sections versus placeholder conditions? Here's a comparison:
| Feature | Placeholder Conditions | Sections |
|---|---|---|
| Controls | Single placeholder | Multiple paragraphs |
| Syntax | {{placeholderName}} | [[SectionName]]...[[/SectionName]] |
| Best for | Individual data points | Large content blocks |
| Example | Show email only if exists | Show discount section for VIPs |
| Complexity | Simple | Can be nested |
| Use when | One field needs conditional display | Multiple paragraphs need to appear/disappear together |
Quick Decision Guide
-
Use Placeholder Conditions when:
- You need to show/hide a single field
- The content is just one placeholder
- Example:
{{email}}only if email exists
-
Use Sections when:
- You need to show/hide multiple paragraphs
- Content includes text, placeholders, and formatting
- Example: Entire discount section with heading, description, and code
Use sections when you need to show/hide multiple paragraphs or complex content blocks.
Next Steps
Now that you understand sections:
- Learn about Conditions for building rules
- Explore Placeholders for basic data insertion
- Check out Use Case Examples for real-world scenarios