Skip to main content

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

Syntax[[SectionName]]...[[/SectionName]]
ControlsMultiple paragraphs
Best forLarge content blocks
ConditionsOptional, show/hide rules

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:

Before

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]]
After

Generated Document (VIP Customer)

Thank you for your order!

Special Offer:
Get 15% off your next order!
Use code: SAVE15

Your total: $299.00

How 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:

  1. It evaluates the section's condition
  2. If true, the section content is included
  3. 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

  1. Add section markers to your template:

    [[SectionName]]
    Your content here
    [[/SectionName]]
  2. Open the Mapping Config overlay

  3. Go to the Sections tab

  4. Find your section (it will appear automatically)

  5. Set the Action: Show or Hide

  6. Configure Conditions (optional)

  7. 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:

  • DiscountDetails
  • AdditionalNotes
  • PremiumFeatures

Avoid:

  • Section1
  • X
  • Test

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:

FeaturePlaceholder ConditionsSections
ControlsSingle placeholderMultiple paragraphs
Syntax{{placeholderName}}[[SectionName]]...[[/SectionName]]
Best forIndividual data pointsLarge content blocks
ExampleShow email only if existsShow discount section for VIPs
ComplexitySimpleCan be nested
Use whenOne field needs conditional displayMultiple 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:

  1. Learn about Conditions for building rules
  2. Explore Placeholders for basic data insertion
  3. Check out Use Case Examples for real-world scenarios