Purpose
Template Containers in Wonderful Relations serve as an organizational layer for structuring templates in a flexible and modular way. They allow templates to be broken into ordered, structured blocks, making it easier to control content positioning, sorting, and reuse across different parts of the system.
By defining template containers, users gain full control over how different components—such as HTML objects, DataTables, and templates—are arranged and displayed within a page. Since template containers can be sorted within templates, they provide a structured way to determine element order, such as placing a header above a DataTable.
Visual Example
Config:
How Template Containers Work
1. Structural Role
- A Template Container is a wrapper that holds HTML objects, DataTables, or nested templates.
- It acts as an ordering mechanism, allowing for fine-grained control over content placement within a template.
- Sorting priority ensures that elements appear in a defined sequence.
2. Relationship with Templates
- A single template can contain multiple template containers.
- Each container can hold different content types (HTML objects, DataTables, or even other templates).
- This structure ensures that sections are properly organized and reusable across multiple templates.
3. Integration with PDF Templates
Template Containers are also used within PDF Templates, following this hierarchy:
PDF Template → PDF Template Container → Template Container
- This nested structure allows flexible PDF output, where different sections (e.g., headers, footers, content blocks) can be independently structured and positioned.
- A PDF Template Container can contain multiple Template Containers, which dictate how sections of a PDF are formatted and displayed.
Parameters
A Template Container consists of the following parameters:
Title
The display name of the container.
Description
A brief explanation of the container’s purpose.
Sort Order
Defines the position of the container within a template.
Why Template Containers Are Essential
- Provide structure & sorting for template components
- Enable modular, reusable template organization
- Work seamlessly with DataTables, HTML objects, and nested templates
- Play a key role in both web templates & PDF templates
Template Containers are the backbone of a well-structured template system, ensuring that all elements are neatly arranged, sortable, and reusable across different contexts. 🚀