Skip to main content Link Search Menu Expand Document (external link)

@data-test : The Conditional Test Expression Attribute

The data-test attribute evaluates boolean expressions to conditionally render content within <if> elements. When the expression evaluates to true, the content is rendered; when false, the content is completely omitted from the PDF output. This enables sophisticated conditional logic for dynamic document generation.


Summary

The data-test attribute provides conditional rendering capabilities, enabling:

  • Boolean expression evaluation for dynamic content control
  • Complete content removal when condition is false (not just hidden)
  • Complex logical operations with AND, OR, NOT operators
  • Data-driven document structure based on runtime values
  • Flexible conditional logic for any document scenario

This attribute is essential for:

  • Personalized documents with user-specific content
  • Role-based content inclusion (admin vs. user views)
  • Status-dependent sections (draft, published, archived)
  • Configuration-driven document generation
  • Multi-language document variants
  • Conditional formatting and styling
  • Business logic implementation in templates

Behavior: When data-test evaluates to false, the <if> element and its content are not rendered at all, reducing document size and processing time.


Usage

The data-test attribute is applied to <if> elements:

<if data-test="">
    <!-- Content rendered only when showSection is true -->
    <div>Conditional content</div>
</if>

Basic Syntax

<!-- Simple boolean property -->
<if data-test="">
    <div>Active content</div>
</if>

<!-- Comparison expression -->
<if data-test="">
    <div>Adult content</div>
</if>

<!-- Logical operators -->
<if data-test="">
    <div>Admin content</div>
</if>

<!-- Negation -->
<if data-test="">
    <div>Visible content</div>
</if>

Supported Elements

The data-test attribute is only supported on the following element:

  • <if> - The conditional rendering element

Note: This attribute is required on <if> elements. Without data-test, the <if> element will always render its content.


Binding Values

Expression Types

The data-test attribute accepts any expression that evaluates to a boolean value:

Expression Type Example Description
Boolean Property `` Direct boolean value from model
Comparison `` Numeric or string comparison
Equality `` Equality check
Inequality `` Not equal check
Logical AND `` Both conditions must be true
Logical OR `` At least one condition true
Negation `` Logical NOT
Null Check `` Check for null values
Length Check `` Array/collection size
Complex `` Combined logic

Type

Type: boolean (or expression that evaluates to boolean) Default: N/A (attribute is required on <if> elements)

Comparison Operators

Supported comparison operators:

Operator Description Example
== Equal to ``
!= Not equal to ``
> Greater than ``
>= Greater than or equal ``
< Less than ``
<= Less than or equal ``

Logical Operators

Supported logical operators:

Operator Description Example
&& Logical AND ``
\|\| Logical OR ``
! Logical NOT ``

Operator Precedence

From highest to lowest precedence:

  1. Parentheses ()
  2. Negation !
  3. Comparison ==, !=, >, <, >=, <=
  4. Logical AND &&
  5. Logical OR ||

Notes

Complete Content Removal

Unlike CSS-based hiding, data-test="false" completely removes content:

  • Content is not included in the PDF structure
  • No space is allocated for the content
  • Processing time is reduced (content not evaluated)
  • PDF file size is smaller (content not included)

Evaluation Timing

Expressions are evaluated during the data binding phase:

  • Occurs before layout and rendering
  • Model values must be available at binding time
  • Changes to model after binding don’t affect rendered output

Truthy and Falsy Values

JavaScript-style truthy/falsy evaluation:

Falsy values (evaluate to false):

  • false (boolean)
  • 0 (number)
  • "" (empty string)
  • null
  • undefined

Truthy values (evaluate to true):

  • true (boolean)
  • Non-zero numbers
  • Non-empty strings
  • Objects and arrays (even if empty)

Common Patterns

Null/Undefined Checks:

<if data-test="">
    <div></div>
</if>

Empty Collection Checks:

<if data-test="">
    <template data-bind="">
        <div></div>
    </template>
</if>

Multiple Conditions:

<if data-test="">
    <div>Valid subscription</div>
</if>

Nesting Conditionals

Conditionals can be nested for complex logic:

<if data-test="">
    <if data-test="">
        <!-- Shown only if both conditions true -->
        <div>Active with permission</div>
    </if>
</if>

Alternative Approaches

For simple visibility control, consider alternatives:

CSS-based hiding (content still in PDF):

<div hidden="">Content</div>

Conditional styling:

<div style="display: ;">Content</div>

Use <if> when content should be completely excluded.

Performance Implications

Conditional rendering improves performance:

  • Reduces PDF processing time
  • Decreases memory usage
  • Smaller PDF file size
  • Faster document generation

For large conditional sections with many items, the performance benefit can be significant.


Examples

1. Simple Boolean Test

Show content based on boolean flag:

<if data-test="">
    <div style="padding: 10pt; background-color: #fff3cd; border: 1pt solid #ffc107;">
        <strong>Disclaimer:</strong> This information is provided for reference only.
    </div>
</if>

2. Numeric Comparison

Show content based on age verification:

<if data-test="">
    <div style="padding: 15pt;">
        <h3>Age-Restricted Content</h3>
        <p>This section is only visible to users 21 and older.</p>
    </div>
</if>

3. String Equality

Display content based on user role:

<if data-test="">
    <div style="background-color: #f8d7da; padding: 10pt; margin: 10pt 0;">
        <strong>Administrator View</strong><br/>
        Internal ID: <br/>
        Created: 
    </div>
</if>

4. Logical AND

Require multiple conditions:

<if data-test="">
    <div style="background-color: #d4edda; padding: 15pt; border: 2pt solid #28a745;">
        <strong>Premium Discount Applied!</strong><br/>
        You saved $ on this order.
    </div>
</if>

5. Logical OR

Show content if any condition is true:

<if data-test="">
    <div style="background-color: #fff3cd; padding: 10pt; border-left: 5pt solid #ffc107;">
        <strong>⚠ Attention Required</strong><br/>
        This item requires immediate attention.
    </div>
</if>

6. Negation

Show content when condition is false:

<if data-test="">
    <div>
        <h3></h3>
        <p></p>
    </div>
</if>

7. Null Check

Verify value exists before displaying:

<if data-test="">
    <div style="margin: 15pt 0; padding: 10pt; border: 1pt dashed #666;">
        <strong>Special Instructions:</strong><br/>
        
    </div>
</if>

8. Collection Length Check

Show section only if items exist:

<if data-test="">
    <h2>Order Items</h2>
    <table style="width: 100%;">
        <template data-bind="">
            <tr>
                <td></td>
                <td>$</td>
            </tr>
        </template>
    </table>
</if>

9. Status-Based Display

Different sections based on order status:

<if data-test="">
    <div style="color: orange; font-weight: bold; padding: 10pt; background-color: #fff3cd;">
        ⧗ Order Pending - Awaiting processing
    </div>
</if>

<if data-test="">
    <div style="color: green; font-weight: bold; padding: 10pt; background-color: #d4edda;">
        ✓ Order Shipped - Tracking: 
    </div>
</if>

<if data-test="">
    <div style="color: blue; font-weight: bold; padding: 10pt; background-color: #d1ecf1;">
        ✓ Order Delivered - 
    </div>
</if>

10. Complex Conditional Logic

Multiple conditions with parentheses:

<if data-test="">
    <div style="background-color: #e7f3ff; padding: 15pt; border: 2pt solid #0066cc;">
        <h3 style="margin: 0 0 10pt 0;">VIP Benefits Applied</h3>
        <ul style="margin: 0;">
            <li>Free expedited shipping</li>
            <li>Priority customer support</li>
            <li>Extended return period (60 days)</li>
        </ul>
    </div>
</if>

11. Date-Based Conditional

Show content based on date comparison:

<if data-test="">
    <div style="background-color: #fff3cd; padding: 12pt; margin: 10pt 0; border-left: 4pt solid #ffc107;">
        <strong>⚠ Expiration Warning</strong><br/>
        This item expires in  days on .
    </div>
</if>

12. Permission-Based Sections

Multiple permission levels:

<!-- Public content (always shown) -->
<div>
    <h2>Public Information</h2>
    <p></p>
</div>

<!-- Member-only content -->
<if data-test="">
    <div style="page-break-before: always;">
        <h2>Member Content</h2>
        <p></p>
    </div>
</if>

<!-- Premium member content -->
<if data-test="">
    <div style="page-break-before: always;">
        <h2>Premium Content</h2>
        <p></p>
    </div>
</if>

<!-- Admin content -->
<if data-test="">
    <div style="page-break-before: always; background-color: #f0f0f0;">
        <h2>Administrative Data</h2>
        <p></p>
    </div>
</if>

13. Invoice Payment Status

Conditional payment messages:

<div style="margin-top: 30pt;">
    <if data-test="">
        <div style="background-color: #d4edda; padding: 15pt; border: 2pt solid #28a745;">
            <h3 style="color: #28a745; margin: 0;">✓ PAID</h3>
            <p style="margin: 5pt 0 0 0;">
                Payment received on <br/>
                Payment method: 
            </p>
        </div>
    </if>

    <if data-test="">
        <div style="background-color: #fff3cd; padding: 15pt; border: 2pt solid #ffc107;">
            <h3 style="color: #856404; margin: 0;">⧗ PAYMENT DUE</h3>
            <p style="margin: 5pt 0 0 0;">
                Due date: <br/>
                Amount due: $
            </p>
        </div>
    </if>

    <if data-test="">
        <div style="background-color: #f8d7da; padding: 15pt; border: 2pt solid #dc3545;">
            <h3 style="color: #dc3545; margin: 0;">⚠ OVERDUE</h3>
            <p style="margin: 5pt 0 0 0;">
                This invoice is  days overdue.<br/>
                Amount due: $<br/>
                Late fees may apply.
            </p>
        </div>
    </if>
</div>

14. Nested Conditionals

Complex nested logic:

<if data-test="">
    <div style="margin: 15pt 0;">
        <h3>Insurance Coverage</h3>
        <p>Policy Number: </p>

        <if data-test="">
            <div style="padding: 10pt; background-color: #d4edda;">
                <strong>Comprehensive Coverage</strong><br/>
                Full coverage including collision and liability.
            </div>
        </if>

        <if data-test="">
            <div style="padding: 10pt; background-color: #fff3cd;">
                <strong>Basic Coverage</strong><br/>
                Standard liability coverage only.
            </div>
        </if>
    </div>
</if>

15. Conditional Tables

Show entire table based on data presence:

<if data-test="">
    <h2>Line Items</h2>
    <table style="width: 100%; border-collapse: collapse;">
        <thead>
            <tr style="background-color: #f0f0f0;">
                <th style="padding: 8pt; border: 1pt solid black;">Description</th>
                <th style="padding: 8pt; border: 1pt solid black; text-align: right;">Qty</th>
                <th style="padding: 8pt; border: 1pt solid black; text-align: right;">Price</th>
                <th style="padding: 8pt; border: 1pt solid black; text-align: right;">Total</th>
            </tr>
        </thead>
        <tbody>
            <template data-bind="">
                <tr>
                    <td style="padding: 6pt; border: 1pt solid #ddd;"></td>
                    <td style="padding: 6pt; border: 1pt solid #ddd; text-align: right;"></td>
                    <td style="padding: 6pt; border: 1pt solid #ddd; text-align: right;">$</td>
                    <td style="padding: 6pt; border: 1pt solid #ddd; text-align: right; font-weight: bold;">
                        $
                    </td>
                </tr>
            </template>
        </tbody>
    </table>
</if>

16. Multi-Language Support

Language-specific content:

<if data-test="">
    <div>
        <h1>Welcome</h1>
        <p>Thank you for choosing our services.</p>
    </div>
</if>

<if data-test="">
    <div>
        <h1>Bienvenido</h1>
        <p>Gracias por elegir nuestros servicios.</p>
    </div>
</if>

<if data-test="">
    <div>
        <h1>Bienvenue</h1>
        <p>Merci d'avoir choisi nos services.</p>
    </div>
</if>

17. Conditional Styling and Formatting

Show warnings based on threshold:

<div>
    <h3>Account Balance: $</h3>

    <if data-test="">
        <div style="color: red; font-weight: bold; padding: 10pt; background-color: #f8d7da;">
            ⚠ OVERDRAWN - Immediate action required
        </div>
    </if>

    <if data-test="">
        <div style="color: orange; font-weight: bold; padding: 10pt; background-color: #fff3cd;">
            ⚠ Low balance warning
        </div>
    </if>

    <if data-test="">
        <div style="color: green; padding: 10pt; background-color: #d4edda;">
            ✓ Account in good standing
        </div>
    </if>
</div>

18. Configuration-Driven Sections

Show sections based on configuration:

<if data-test="">
    <div style="page-break-after: always;">
        <h1>Executive Summary</h1>
        <p></p>
    </div>
</if>

<if data-test="">
    <div style="page-break-after: always;">
        <h1>Detailed Analysis</h1>
        <p></p>
    </div>
</if>

<if data-test="">
    <div style="page-break-after: always;">
        <h1>Charts and Graphs</h1>
        <!-- Chart content -->
    </div>
</if>

<if data-test="">
    <div style="page-break-after: always;">
        <h1>Appendix</h1>
        <p></p>
    </div>
</if>

19. Dynamic Document Sections

Build document structure from data:

<template data-bind="">
    <if data-test="">
        <div style="margin-bottom: 30pt;">
            <h2></h2>

            <if data-test="">
                <p style="font-style: italic;"></p>
            </if>

            <div><h1 id="data-template--the-inline-template-content-attribute">@data-template : The Inline Template Content Attribute</h1>

<p>The <code class="language-plaintext highlighter-rouge">data-template</code> attribute allows you to define template content inline as a string attribute value, rather than as child elements. This provides a convenient way to specify simple templates, dynamically generate template content, or create templates from external sources.</p>

<hr />

<h2 id="summary">Summary</h2>

<p>The <code class="language-plaintext highlighter-rouge">data-template</code> attribute enables inline template definition, providing:</p>
<ul>
  <li><strong>Inline HTML content</strong> specification as an attribute value</li>
  <li><strong>Dynamic template generation</strong> from code or external sources</li>
  <li><strong>Simplified syntax</strong> for simple templates</li>
  <li><strong>Programmatic template creation</strong> without DOM manipulation</li>
</ul>

<p>This attribute is useful for:</p>
<ul>
  <li>Simple conditional templates with minimal content</li>
  <li>Dynamically generated template content</li>
  <li>Templates loaded from databases or external files</li>
  <li>Programmatic document generation</li>
  <li>Templates with content determined at runtime</li>
</ul>

<p><strong>Note</strong>: When <code class="language-plaintext highlighter-rouge">data-template</code> is specified, it takes precedence over child elements within the template or conditional component.</p>

<hr />

<h2 id="usage">Usage</h2>

<p>The <code class="language-plaintext highlighter-rouge">data-template</code> attribute is applied to <code class="language-plaintext highlighter-rouge">&lt;if&gt;</code> elements and can be used with <code class="language-plaintext highlighter-rouge">&lt;template&gt;</code> elements (via the <code class="language-plaintext highlighter-rouge">data-content</code> attribute synonym):</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Simple conditional template --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='color: red;'&gt;Important message&lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- On template element (use data-content) --&gt;</span>
<span class="nt">&lt;template</span> <span class="na">data-bind=</span><span class="s">""</span>
          <span class="na">data-content=</span><span class="s">"&lt;div&gt;&lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/template&gt;</span>
</code></pre></div></div>

<h3 id="basic-syntax">Basic Syntax</h3>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Conditional rendering with inline template --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;p&gt;HTML content here&lt;/p&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- Bound value for dynamic template --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- Template element (use data-content attribute) --&gt;</span>
<span class="nt">&lt;template</span> <span class="na">data-bind=</span><span class="s">""</span>
          <span class="na">data-content=</span><span class="s">"&lt;span&gt;&lt;/span&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/template&gt;</span>
</code></pre></div></div>

<hr />

<h2 id="supported-elements">Supported Elements</h2>

<p>The <code class="language-plaintext highlighter-rouge">data-template</code> attribute is supported on the following elements:</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">&lt;if&gt;</code> - Conditional rendering element</li>
</ul>

<p><strong>Note</strong>: For <code class="language-plaintext highlighter-rouge">&lt;template&gt;</code> elements, use the synonym attribute <code class="language-plaintext highlighter-rouge">data-content</code> instead.</p>

<hr />

<h2 id="binding-values">Binding Values</h2>

<h3 id="attribute-values">Attribute Values</h3>

<table>
  <thead>
    <tr>
      <th>Value Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>HTML String</strong></td>
      <td>Literal HTML markup as a string</td>
    </tr>
    <tr>
      <td><strong>Binding Expression</strong></td>
      <td>Expression that evaluates to HTML string: ``</td>
    </tr>
  </tbody>
</table>

<h3 id="type">Type</h3>

<p><strong>Type</strong>: <code class="language-plaintext highlighter-rouge">string</code> (HTML markup)
<strong>Default</strong>: <code class="language-plaintext highlighter-rouge">null</code> (use child elements)</p>

<h3 id="expression-support">Expression Support</h3>

<p>The attribute accepts literal HTML strings or binding expressions:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Literal HTML --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div class='alert'&gt;Alert content&lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- Bound from model --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- Conditional expression --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<hr />

<h2 id="notes">Notes</h2>

<h3 id="precedence-over-child-elements">Precedence Over Child Elements</h3>

<p>When <code class="language-plaintext highlighter-rouge">data-template</code> is specified, it takes precedence over any child elements:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- This child content is IGNORED --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;p&gt;Inline template&lt;/p&gt;"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;p&gt;</span>This content will NOT be rendered<span class="nt">&lt;/p&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- Rendered output will be: &lt;p&gt;Inline template&lt;/p&gt; --&gt;</span>
</code></pre></div></div>

<h3 id="html-escaping">HTML Escaping</h3>

<p>HTML content within the attribute value must be properly escaped:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Single quotes inside double quotes --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='color: red;'&gt;Text&lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="c">&lt;!-- Or use HTML entities --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style=&amp;quot;color: red;&amp;quot;&gt;Text&lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="data-binding-within-templates">Data Binding Within Templates</h3>

<p>Inline templates support full data binding syntax:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div&gt;&lt;strong&gt;&lt;/strong&gt; - &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="namespace-handling">Namespace Handling</h3>

<p>When used within HTML documents, the inline template content inherits the HTML namespace automatically:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;html</span> <span class="na">xmlns=</span><span class="s">'http://www.w3.org/1999/xhtml'</span><span class="nt">&gt;</span>
<span class="nt">&lt;body&gt;</span>
    <span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
        <span class="na">data-template=</span><span class="s">"&lt;div&gt;Content&lt;/div&gt;"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;/if&gt;</span>
    <span class="c">&lt;!-- Div element has HTML namespace automatically --&gt;</span>
<span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span>
</code></pre></div></div>

<h3 id="dynamic-template-loading">Dynamic Template Loading</h3>

<p>Templates can be loaded from external sources:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Model: { condition: true, templateContent: "&lt;div&gt;Loaded content&lt;/div&gt;" } --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="multi-line-content">Multi-Line Content</h3>

<p>For readability, use appropriate quoting:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='padding: 10pt; border: 1pt solid black;'&gt;
                      &lt;h3&gt;Title&lt;/h3&gt;
                      &lt;p&gt;Content goes here&lt;/p&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="performance-considerations">Performance Considerations</h3>

<ul>
  <li>Inline templates are parsed once during document initialization</li>
  <li>No significant performance difference vs. child elements</li>
  <li>Useful for programmatic generation to avoid DOM manipulation</li>
  <li>Cache template strings when generating many similar templates</li>
</ul>

<h3 id="comparison-with-child-elements">Comparison with Child Elements</h3>

<p><strong>Use inline templates when</strong>:</p>
<ul>
  <li>Content is simple and fits in one line</li>
  <li>Template is generated dynamically</li>
  <li>Content is loaded from external source</li>
  <li>Programmatic generation is easier</li>
</ul>

<p><strong>Use child elements when</strong>:</p>
<ul>
  <li>Content is complex or multi-line</li>
  <li>Better readability is desired</li>
  <li>IDE support for HTML editing is important</li>
  <li>Content contains many nested elements</li>
</ul>

<hr />

<h2 id="examples">Examples</h2>

<h3 id="1-simple-conditional-message">1. Simple Conditional Message</h3>

<p>Display a simple message conditionally:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='color: red; font-weight: bold;'&gt;Error occurred!&lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="2-dynamic-content-from-model">2. Dynamic Content from Model</h3>

<p>Load template content from model property:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Model: { showNotice: true, noticeHtml: "&lt;div class='notice'&gt;Important notice&lt;/div&gt;" } --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="3-conditional-badge">3. Conditional Badge</h3>

<p>Display different badge styles:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;span style='background-color: red; color: white; padding: 5pt; border-radius: 3pt;'&gt;URGENT&lt;/span&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;span style='background-color: green; color: white; padding: 5pt; border-radius: 3pt;'&gt;NORMAL&lt;/span&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="4-inline-alert-box">4. Inline Alert Box</h3>

<p>Conditional alert with styling:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='background-color: #fff3cd; border: 1pt solid #ffc107; padding: 15pt; margin: 10pt 0;'&gt;
                      &lt;strong&gt;Warning:&lt;/strong&gt; 
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="5-dynamic-icon-display">5. Dynamic Icon Display</h3>

<p>Show different icons based on status:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;span style='color: green; font-size: 14pt;'&gt;✓ Complete&lt;/span&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;span style='color: orange; font-size: 14pt;'&gt;⧗ In Progress&lt;/span&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="6-programmatically-generated-template">6. Programmatically Generated Template</h3>

<p>Generate template content in code:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Model: { showDetails: true, detailsHtml: GenerateDetailsHtml() } --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<div class="language-csharp highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// C# code to generate template</span>
<span class="kt">string</span> <span class="nf">GenerateDetailsHtml</span><span class="p">()</span>
<span class="p">{</span>
    <span class="kt">var</span> <span class="n">sb</span> <span class="p">=</span> <span class="k">new</span> <span class="nf">StringBuilder</span><span class="p">();</span>
    <span class="n">sb</span><span class="p">.</span><span class="nf">Append</span><span class="p">(</span><span class="s">"&lt;div style='padding: 10pt;'&gt;"</span><span class="p">);</span>
    <span class="n">sb</span><span class="p">.</span><span class="nf">Append</span><span class="p">(</span><span class="s">"&lt;h3&gt;Generated Details&lt;/h3&gt;"</span><span class="p">);</span>
    <span class="n">sb</span><span class="p">.</span><span class="nf">Append</span><span class="p">(</span><span class="s">"&lt;ul&gt;"</span><span class="p">);</span>
    <span class="k">foreach</span> <span class="p">(</span><span class="kt">var</span> <span class="n">item</span> <span class="k">in</span> <span class="n">items</span><span class="p">)</span>
    <span class="p">{</span>
        <span class="n">sb</span><span class="p">.</span><span class="nf">AppendFormat</span><span class="p">(</span><span class="s">"&lt;li&gt;{0}&lt;/li&gt;"</span><span class="p">,</span> <span class="n">item</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="n">sb</span><span class="p">.</span><span class="nf">Append</span><span class="p">(</span><span class="s">"&lt;/ul&gt;"</span><span class="p">);</span>
    <span class="n">sb</span><span class="p">.</span><span class="nf">Append</span><span class="p">(</span><span class="s">"&lt;/div&gt;"</span><span class="p">);</span>
    <span class="k">return</span> <span class="n">sb</span><span class="p">.</span><span class="nf">ToString</span><span class="p">();</span>
<span class="p">}</span>
</code></pre></div></div>

<h3 id="7-database-loaded-template">7. Database-Loaded Template</h3>

<p>Load template content from database:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Model: { showCustomSection: true, customHtml: LoadFromDatabase("section_template") } --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="8-conditional-pricing-display">8. Conditional Pricing Display</h3>

<p>Show pricing with conditional formatting:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='text-align: center;'&gt;
                      &lt;div style='text-decoration: line-through; color: #999;'&gt;$&lt;/div&gt;
                      &lt;div style='color: red; font-size: 16pt; font-weight: bold;'&gt;$&lt;/div&gt;
                      &lt;div style='color: red; font-size: 10pt;'&gt;Save %!&lt;/div&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="9-conditional-footer-note">9. Conditional Footer Note</h3>

<p>Add conditional footer information:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='margin-top: 20pt; padding: 10pt; background-color: #f8d7da; border: 2pt solid #dc3545;'&gt;
                      &lt;strong style='color: #dc3545;'&gt;CONFIDENTIAL:&lt;/strong&gt;
                      This document contains proprietary information.
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="10-inline-user-badge">10. Inline User Badge</h3>

<p>Display user type badge:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;div&gt;</span>
    User: 
    <span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
        <span class="na">data-template=</span><span class="s">"&lt;span style='background-color: #dc3545; color: white; padding: 3pt 8pt; margin-left: 5pt; font-size: 8pt; border-radius: 3pt;'&gt;ADMIN&lt;/span&gt;"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;/if&gt;</span>
    <span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
        <span class="na">data-template=</span><span class="s">"&lt;span style='background-color: #ffc107; color: black; padding: 3pt 8pt; margin-left: 5pt; font-size: 8pt; border-radius: 3pt;'&gt;PREMIUM&lt;/span&gt;"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;/if&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</code></pre></div></div>

<h3 id="11-conditional-watermark">11. Conditional Watermark</h3>

<p>Add watermark for draft documents:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='position: absolute; top: 50%; left: 50%; transform: rotate(-45deg);
                               font-size: 72pt; color: rgba(255,0,0,0.2); font-weight: bold;'&gt;
                      DRAFT
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="12-simple-table-row">12. Simple Table Row</h3>

<p>Conditional table row with inline template:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;table</span> <span class="na">style=</span><span class="s">"width: 100%;"</span><span class="nt">&gt;</span>
    <span class="nt">&lt;tr&gt;</span>
        <span class="nt">&lt;td&gt;</span>Order Status:<span class="nt">&lt;/td&gt;</span>
        <span class="nt">&lt;td&gt;</span>
            <span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
                <span class="na">data-template=</span><span class="s">"&lt;span style='color: green; font-weight: bold;'&gt;✓ Shipped&lt;/span&gt;"</span><span class="nt">&gt;</span>
            <span class="nt">&lt;/if&gt;</span>
            <span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
                <span class="na">data-template=</span><span class="s">"&lt;span style='color: orange; font-weight: bold;'&gt;⧗ Pending&lt;/span&gt;"</span><span class="nt">&gt;</span>
            <span class="nt">&lt;/if&gt;</span>
            <span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
                <span class="na">data-template=</span><span class="s">"&lt;span style='color: red; font-weight: bold;'&gt;✗ Cancelled&lt;/span&gt;"</span><span class="nt">&gt;</span>
            <span class="nt">&lt;/if&gt;</span>
        <span class="nt">&lt;/td&gt;</span>
    <span class="nt">&lt;/tr&gt;</span>
<span class="nt">&lt;/table&gt;</span>
</code></pre></div></div>

<h3 id="13-internationalized-content">13. Internationalized Content</h3>

<p>Load locale-specific templates:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- Model: { language: "en", contentEn: "&lt;p&gt;English content&lt;/p&gt;", contentEs: "&lt;p&gt;Contenido español&lt;/p&gt;" } --&gt;</span>
<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">""</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="14-conditional-qr-code">14. Conditional QR Code</h3>

<p>Show QR code with description:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='text-align: center; margin: 20pt 0;'&gt;
                      &lt;img src='' style='width: 100pt; height: 100pt;'/&gt;
                      &lt;div style='font-size: 8pt; color: #666; margin-top: 5pt;'&gt;
                        Scan to access online version
                      &lt;/div&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="15-terms-and-conditions-section">15. Terms and Conditions Section</h3>

<p>Conditionally include terms:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='margin-top: 30pt; padding: 15pt; border-top: 2pt solid black;'&gt;
                      &lt;h3 style='margin: 0 0 10pt 0;'&gt;Terms and Conditions&lt;/h3&gt;
                      &lt;div style='font-size: 8pt; line-height: 1.4;'&gt;
                        
                      &lt;/div&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="16-status-indicator-panel">16. Status Indicator Panel</h3>

<p>Multi-line status panel:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='background-color: #fff3cd; border-left: 5pt solid #ffc107; padding: 15pt; margin: 10pt 0;'&gt;
                      &lt;div style='font-weight: bold; font-size: 12pt; margin-bottom: 5pt;'&gt;
                        System Status Alert
                      &lt;/div&gt;
                      &lt;div&gt;
                        Current Status: &lt;strong&gt;&lt;/strong&gt;
                      &lt;/div&gt;
                      &lt;div style='margin-top: 5pt; font-size: 9pt; color: #666;'&gt;
                        Last Updated: 
                      &lt;/div&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="17-conditional-signature-block">17. Conditional Signature Block</h3>

<p>Add signature block for certain document types:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='margin-top: 40pt; padding: 20pt; border: 1pt solid #000;'&gt;
                      &lt;div style='margin-bottom: 30pt;'&gt;
                        &lt;div&gt;Signature: _________________________________&lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div style='margin-bottom: 10pt;'&gt;
                        &lt;div&gt;Print Name: _________________________________&lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div&gt;
                        &lt;div&gt;Date: _________________________________&lt;/div&gt;
                      &lt;/div&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="18-simple-payment-instructions">18. Simple Payment Instructions</h3>

<p>Conditional payment details:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='background-color: #d1ecf1; padding: 10pt; margin: 10pt 0;'&gt;
                      &lt;strong&gt;Payment Instructions:&lt;/strong&gt;&lt;br/&gt;
                      Please make check payable to: &lt;br/&gt;
                      Mail to: 
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>

<span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='background-color: #d1ecf1; padding: 10pt; margin: 10pt 0;'&gt;
                      &lt;strong&gt;Wire Transfer Instructions:&lt;/strong&gt;&lt;br/&gt;
                      Bank: &lt;br/&gt;
                      Account: &lt;br/&gt;
                      Routing: 
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="19-promotional-banner">19. Promotional Banner</h3>

<p>Conditional promotional content:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='background: linear-gradient(to right, #667eea, #764ba2);
                               color: white; padding: 20pt; text-align: center;
                               margin-bottom: 20pt; border-radius: 5pt;'&gt;
                      &lt;div style='font-size: 18pt; font-weight: bold; margin-bottom: 5pt;'&gt;
                        
                      &lt;/div&gt;
                      &lt;div style='font-size: 12pt;'&gt;
                        
                      &lt;/div&gt;
                      &lt;div style='margin-top: 10pt; font-size: 9pt;'&gt;
                        Offer expires: 
                      &lt;/div&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<h3 id="20-complex-conditional-layout">20. Complex Conditional Layout</h3>

<p>Multi-section conditional content:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;if</span> <span class="na">data-test=</span><span class="s">""</span>
    <span class="na">data-template=</span><span class="s">"&lt;div style='border: 2pt solid #336699; padding: 15pt; margin: 20pt 0;'&gt;
                      &lt;div style='background-color: #336699; color: white; padding: 10pt; margin: -15pt -15pt 15pt -15pt;'&gt;
                        &lt;h2 style='margin: 0;'&gt;Detailed Summary&lt;/h2&gt;
                      &lt;/div&gt;
                      &lt;table style='width: 100%; border-collapse: collapse;'&gt;
                        &lt;tr&gt;
                          &lt;td style='padding: 5pt; border-bottom: 1pt solid #ddd; font-weight: bold;'&gt;Total Items:&lt;/td&gt;
                          &lt;td style='padding: 5pt; border-bottom: 1pt solid #ddd; text-align: right;'&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                          &lt;td style='padding: 5pt; border-bottom: 1pt solid #ddd; font-weight: bold;'&gt;Subtotal:&lt;/td&gt;
                          &lt;td style='padding: 5pt; border-bottom: 1pt solid #ddd; text-align: right;'&gt;$&lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                          &lt;td style='padding: 5pt; border-bottom: 1pt solid #ddd; font-weight: bold;'&gt;Tax:&lt;/td&gt;
                          &lt;td style='padding: 5pt; border-bottom: 1pt solid #ddd; text-align: right;'&gt;$&lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                          &lt;td style='padding: 5pt; font-weight: bold; font-size: 12pt;'&gt;Total:&lt;/td&gt;
                          &lt;td style='padding: 5pt; text-align: right; font-weight: bold; font-size: 12pt;'&gt;$&lt;/td&gt;
                        &lt;/tr&gt;
                      &lt;/table&gt;
                   &lt;/div&gt;"</span><span class="nt">&gt;</span>
<span class="nt">&lt;/if&gt;</span>
</code></pre></div></div>

<hr />

<h2 id="see-also">See Also</h2>

<ul>
  <li><a href="/reference/htmltags/if.html">if element</a> - Conditional rendering element</li>
  <li><a href="/reference/htmlattributes/data-content.html">data-content attribute</a> - Synonym for template elements</li>
  <li><a href="/reference/htmlattributes/data-test.html">data-test attribute</a> - Conditional test expressions</li>
  <li><a href="/reference/htmltags/template.html">template element</a> - Template for repeating content</li>
  <li><a href="/reference/binding/">Data Binding</a> - Complete data binding guide</li>
  <li><a href="/reference/expressions/">Expressions</a> - Expression syntax reference</li>
</ul>

<hr />
</div>

            <if data-test="">
                <div style="font-size: 9pt; color: #666; margin-top: 10pt;">
                    
                </div>
            </if>
        </div>
    </if>
</template>

20. Comprehensive Business Logic

Complex real-world scenario:

<div class="document">
    <!-- Header always shown -->
    <div style="background-color: #336699; color: white; padding: 20pt;">
        <h1 style="margin: 0;"></h1>
        <div>Date: </div>
    </div>

    <!-- Main content -->
    <div style="padding: 20pt;">
        <!-- Standard content -->
        <p></p>

        <!-- VIP customer benefits -->
        <if data-test="">
            <div style="background-color: #fff9e6; padding: 15pt; margin: 15pt 0; border: 2pt solid #ffd700;">
                <h3 style="color: #b8860b; margin: 0 0 10pt 0;">VIP Customer Benefits</h3>
                <ul style="margin: 0;">
                    <li>24/7 Priority Support</li>
                    <li>Free shipping on all orders</li>
                    <li>Exclusive early access to new products</li>
                </ul>
            </div>
        </if>

        <!-- Account warnings -->
        <if data-test="">
            <div style="background-color: #f8d7da; padding: 15pt; margin: 15pt 0; border: 2pt solid #dc3545;">
                <h3 style="color: #dc3545; margin: 0 0 10pt 0;">Account Action Required</h3>

                <if data-test="">
                    <p>Your account balance is negative: $</p>
                </if>

                <if data-test="">
                    <p>You have invoices that are  days overdue.</p>
                </if>

                <p style="font-weight: bold;">Please contact accounting immediately.</p>
            </div>
        </if>

        <!-- Regional-specific content -->
        <if data-test="">
            <div style="margin: 15pt 0; padding: 10pt; border: 1pt solid #0066cc; background-color: #e7f3ff;">
                <strong>EU Customers:</strong> All prices include VAT as required by EU regulations.
            </div>
        </if>

        <!-- Promotional content -->
        <if data-test="">
            <div style="background-color: #d4edda; padding: 15pt; margin: 15pt 0;">
                <h3 style="color: #28a745; margin: 0 0 10pt 0;">Special Offer Available!</h3>
                <p></p>
                <p style="font-weight: bold;">Offer expires: </p>
            </div>
        </if>
    </div>

    <!-- Footer -->
    <div style="margin-top: 30pt; padding: 15pt; border-top: 2pt solid #336699;">
        <if data-test="">
            <div style="color: red; font-weight: bold; text-align: center; margin-bottom: 10pt;">
                CONFIDENTIAL - DO NOT DISTRIBUTE
            </div>
        </if>

        <if data-test="">
            <div style="color: #666; font-style: italic; text-align: center; margin-bottom: 10pt;">
                DRAFT - Not for Distribution
            </div>
        </if>

        <div style="text-align: center; font-size: 9pt; color: #666;">
            Generated:  | Document ID: 
        </div>
    </div>
</div>

See Also