Modules
Create reusable sections that update everywhere at once.
Overview
Modules are reusable sections that can be included in multiple templates. When you edit a module, every template using it updates automatically.
Think of modules as "single source of truth" components.
When to Use Modules
Perfect For
| Use Case | Example |
|---|---|
| Headers | Site header appearing on every page |
| Footers | Site footer appearing on every page |
| CTAs | Call-to-action section used across pages |
| Newsletter signup | Email capture form |
| Contact info | Address/phone appearing in multiple places |
| Testimonials | Customer quotes section |
Benefits
- Consistency - Same content everywhere
- Efficiency - Edit once, update everywhere
- Organization - Keep reusable parts separate
Modules vs Blueprints
TheDock has two types of reusable content:
| Type | Behavior |
|---|---|
| Module | Linked - changes sync everywhere |
| Blueprint | Copied - creates independent content |
Modules (Linked)
When you use a module:
- Content is linked to the source module
- Editing the module updates all instances
- Great for content that should be identical everywhere
Blueprints (Copied)
When you use a blueprint:
- Content is copied as static elements
- Changes only affect that specific copy
- Great for starting points that you'll customize
Managing Modules
Accessing Modules
- Click B. Layout in navigation
- Click Modules in the sidebar
Module Categories
| Category | Description |
|---|---|
| In Use | Modules currently used in templates |
| Unused | Created modules not in any template |
| Library | Pre-built module blueprints |
Creating Modules
New Module from Scratch
- In Modules, click New Module
- Name your module
- Build using the same editor as templates
- A module contains: Sections → Grids → Areas → Blocks
From Existing Section
- While editing a template
- Select a section you want to reuse
- Click Save as Module in the action menu
- Name the module
- The section becomes a linked module
From Blueprint
- Browse the Library
- Click a blueprint to preview
- Click Save as Module
- The blueprint becomes your own module
Editing Modules
Opening the Module Editor
- Go to B. Layout > Modules
- Find the module you want to edit
- Click Edit
Making Changes
The module editor works like the template editor:
- Add/remove sections and blocks
- Configure settings
- Preview changes
Changes Propagate Everywhere
When you save a module, all templates using it update automatically.
Warning: Be careful - changes affect every instance!
Using Modules in Templates
Adding a Module to a Template
- Open a template for editing
- Click + to add a section
- Select From Module
- Choose the module to insert
- The module appears as a linked section
Identifying Modules
In the template tree view, modules are marked with a special icon and show:
- Module name
- "Linked" indicator
- Link to edit the source module
Positioning Modules
Modules can be placed anywhere sections can go:
- Top of template (for headers)
- Between content sections
- Bottom of template (for footers)
Detaching Modules
Sometimes you want to break the link and make a module's content independent.
How to Detach
- In the template editor
- Select the module section
- Click Detach from Module
- The content becomes static in that template only
After Detaching
- That section no longer updates with the module
- You can customize it independently
- Other instances of the module remain linked
Header and Footer Modules
Headers and footers are special modules assigned globally.
Setting a Global Header
- Go to B. Layout > Header
- Select a module to use as header
- All templates show this header
Setting a Global Footer
- Go to B. Layout > Footer
- Select a module to use as footer
- All templates show this footer
Template-Specific Headers/Footers
If a template needs a different header/footer:
- Open the template
- Add a module section at top/bottom
- Choose a different header/footer module
Modules as Flexible Content (Page Builder)
One of TheDock's most powerful features is the ability to export modules as flexible content sections that WordPress editors can add to pages—essentially creating a page builder experience.
What is Flexible Content?
Flexible content lets editors compose pages by adding, removing, and reordering pre-designed sections. Instead of a fixed layout, editors choose from a library of modules you've created.
Traditional Template: Flexible Content:
┌────────────────────┐ ┌────────────────────┐
│ Header │ │ Header │
├────────────────────┤ ├────────────────────┤
│ Hero Section │ │ [Editor chooses] │
├────────────────────┤ │ + Hero │
│ Features Grid │ │ + Testimonials │
├────────────────────┤ │ + CTA │
│ Testimonials │ │ + Features │
├────────────────────┤ │ (any order, │
│ CTA │ │ any combination) │
├────────────────────┤ ├────────────────────┤
│ Footer │ │ Footer │
└────────────────────┘ └────────────────────┘
Enabling Modules for Flexible Content
To make a module available as flexible content:
- Go to B. Layout > Modules
- Find the module you want to enable
- Click the database icon (Activate Flexible) on the module
- The module is now available as a flexible content section
The icon toggles between:
- Inactive - Module is only usable in TheDock templates
- Active - Module is exported as a flexible content option
Creating a Flexible Section in Templates
Once modules are enabled for flexible content:
- Edit a template
- Add a new section
- Choose Flexible Content as the section type
- Select which ACF flexible content field to use (or create a new one)
- The section becomes a placeholder that editors fill with modules
How Editors Use It
After export, when editors create or edit a page in WordPress:
- They see a Flexible Content field (powered by ACF)
- They click Add Row to add a section
- They choose from your enabled modules (Hero, CTA, Features, etc.)
- They can reorder sections by dragging
- They can remove sections they don't need
- Each module may have its own editable fields
Example: Building a Page Builder
Step 1: Create Your Modules
| Module | Purpose |
|---|---|
| Hero - Centered | Large headline, centered text, CTA button |
| Hero - Split | Image on one side, text on the other |
| Features Grid | 3-column feature cards |
| Testimonials Slider | Customer quotes carousel |
| CTA Banner | Full-width call-to-action |
| Team Grid | Team member photos and bios |
| FAQ Accordion | Expandable questions and answers |
| Contact Form | Form with map |
Step 2: Enable for Flexible Content
Click the database icon on each module you want editors to access.
Step 3: Create a Flexible Template
- Create a new template (e.g., "Page - Builder")
- Add Header module at top
- Add a Flexible Content section in the middle
- Add Footer module at bottom
- Mark template for export
Step 4: Export and Test
After export, editors can create pages using this template and compose unique layouts from your modules.
Module Fields in Flexible Content
When a module is used as flexible content, any custom fields in that module become editable per-instance:
- Static content (set in TheDock) stays the same
- Dynamic fields (custom fields) can be edited per section
For example, a "Hero" module might have:
- Fixed: Layout structure, styling, animations
- Editable: Headline text, background image, button text, button link
Best Practices for Flexible Modules
1. Design for Flexibility
Create modules that work well in any order:
- Don't assume what comes before/after
- Use consistent spacing
- Consider background color transitions
2. Name Modules Clearly
Editors see these names when adding sections:
- ✅ "Hero - Centered with Video"
- ✅ "3-Column Features"
- ❌ "Section 1"
- ❌ "New Module"
3. Provide Variety
Offer multiple versions of common sections:
- Hero (centered, split, video background)
- Features (2-column, 3-column, icon-based)
- Testimonials (single, slider, grid)
4. Keep Modules Self-Contained
Each module should look complete on its own:
- Include appropriate padding
- Handle its own background
- Don't rely on adjacent sections
5. Test All Combinations
Before launching, test modules in various orders to ensure they work well together.
Module Best Practices
1. Plan Your Modules
Before building, identify what should be modules:
- What appears on multiple pages?
- What needs to stay consistent?
2. Name Clearly
Use descriptive names: "Main Header", "Newsletter CTA", "Contact Footer"
3. Keep Modules Focused
One purpose per module. Don't create mega-modules.
4. Test After Changes
Since changes propagate, preview multiple templates after editing.
5. Document Non-Obvious Modules
If a module has special requirements, note them in the name.
6. Use Unused for Staging
Build new modules as "Unused" until ready, then add to templates.
Troubleshooting
Changes not appearing in templates
- Ensure you saved the module
- Check that templates use the module (not detached copies)
- Export theme to see changes on live site
Module shows in wrong position
- Check template structure
- Verify module is in the correct section slot
Can't delete module
- If "In Use", remove from all templates first
- Check that it's not set as global header/footer
Module looks different in different templates
- Check template-level settings (background colors, etc.)
- Module inherits some styling from template context
Related Topics
- Templates - Using modules in templates
- Header - Global header configuration
- Footer - Global footer configuration