> ## Documentation Index
> Fetch the complete documentation index at: https://helpdocs.gavel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Template: Show Paragraph and Phrases

> Show or hide inline phrases, full paragraphs, numbered clauses, and table rows based on client answers using Gavel's conditional content syntax.

Conditional content lets you build a single document template that produces different output depending on how each client answers your questionnaire. Instead of maintaining separate templates for every scenario, you mark sections of your Word document with simple logic tags — Gavel evaluates those tags at document-generation time and includes or omits the content accordingly. You can apply this logic to anything from a single word to an entire page of clauses.

## Conditional phrases and sentences

A conditional phrase is any inline text — a word, a clause, or a full sentence — that you want to appear only when a certain condition is true. The tags wrap tightly around the text and sit inside the surrounding permanent paragraph.

### Basic syntax

```text theme={null}
{% if VariableName %}Conditional text here.{% endif %}
```

The condition evaluates as true when the variable has a value (for Yes/No questions, this means "Yes").

### Syntax by question type

<Tabs>
  <Tab title="Yes / No">
    Show text when the answer is **Yes**:

    ```text theme={null}
    {% if HasSpouse %}including the Spouse's community property interest{% endif %}
    ```

    Show text when the answer is **No** (i.e., False):

    ```text theme={null}
    {% if HasSpouse == False %}as sole and separate property{% endif %}
    ```
  </Tab>

  <Tab title="Single Select">
    Match a specific choice using `==`:

    ```text theme={null}
    {% if MaritalStatus == "married" %}and spouse{% endif %}
    ```

    Match anything *other* than a value using `!=`:

    ```text theme={null}
    {% if EntityType != "LLC" %}as a corporation{% endif %}
    ```
  </Tab>

  <Tab title="Multi-Select">
    Use `.all_false()` to show text only when none of the checkboxes are selected:

    ```text theme={null}
    {% if Jurisdictions.all_false() %}No jurisdictions selected.{% endif %}
    ```
  </Tab>

  <Tab title="Blank answer">
    Show a placeholder when a field is left empty:

    ```text theme={null}
    {% if MiddleName == "" %}N/A{% endif %}
    ```
  </Tab>

  <Tab title="CSV data source">
    Conditions work the same way for variables populated from a CSV data source:

    ```text theme={null}
    {% if CSV_Variable["CSV_Column"] == "Jane Doe" %}Attorney of record{% endif %}
    ```
  </Tab>
</Tabs>

### Multi-condition logic

Combine conditions with `and` or `or` to create more precise rules:

```text theme={null}
{% if MaritalStatus == "Married" and FavoriteColor == "Pink" %}
I am married and my favorite color is pink!
{% endif %}
```

### Using `else` and `elif`

Instead of writing separate `if`/`endif` blocks for every alternative, you can chain conditions using `else` (for one alternative) or `elif` (for multiple alternatives).

**Two options with `else`:**

```text theme={null}
{% if EntityType == "LLC" %}limited liability company{% else %}corporation{% endif %}
```

**Three or more options with `elif`:**

```text theme={null}
{% if MaritalStatus == "single" %}unmarried
{% elif MaritalStatus == "married" %}married
{% elif MaritalStatus == "divorced" %}formerly married
{% endif %}
```

<Tip>
  The Word add-in inserts `else` and `elif` blocks for you through its UI. You only need to type this syntax manually if you are editing the document template directly in Word.
</Tip>

***

## Conditional paragraphs

When the content you want to show or hide is an entire stand-alone paragraph — not inline text within a permanent paragraph — you must use the `{%p ... %}` variant. The `p` flag tells Gavel to remove the paragraph's surrounding whitespace as well, so no blank lines are left behind in the final document.

### Basic syntax

```text theme={null}
{%p if VariableName %}

Conditional paragraph text here.

{%p endif %}
```

<Warning>
  If you use `{% if %}` instead of `{%p if %}` around a standalone paragraph, the blank line that held the tag will remain in the output. Always use `{%p %}` for full-paragraph conditions.
</Warning>

### Conditional numbered paragraphs and table rows

The same `{%p %}` syntax works for numbered lists and table rows. Place the opening tag on its own line immediately before the item, and the closing tag on its own line immediately after:

```text theme={null}
{%p if IncludeArbitrationClause %}
Arbitration. All disputes arising under this Agreement shall be resolved by binding arbitration.
{%p endif %}
```

For a numbered paragraph inside a list, the surrounding numbers automatically re-sequence — Gavel removes the entire item, not just its text.

***

## Using the Word add-in (no-code)

You do not need to type syntax manually. The Gavel Word add-in lets you insert both phrase-level and paragraph-level conditions through a point-and-click interface.

<Steps>
  <Step title="Open the Word add-in">
    Open your document in Microsoft Word and launch the Gavel add-in. Select the workflow you want to use.
  </Step>

  <Step title="Highlight the target text">
    Select the word, sentence, or paragraph you want to make conditional.
  </Step>

  <Step title="Choose the condition type">
    * For inline text within a paragraph, click **Show phrase when...**
    * For a full standalone paragraph, click **Show paragraph when...**
  </Step>

  <Step title="Select the variable and value">
    Choose the variable name and the answer value that should trigger the content to appear.
  </Step>

  <Step title="Add additional conditions (optional)">
    Click **Add Condition** and repeat the previous step to build `and`/`or` multi-condition logic.
  </Step>

  <Step title="Insert">
    Click **Insert**. The add-in writes the correct syntax — including `{%p %}` for paragraph conditions — directly into your document.
  </Step>
</Steps>

<Note>
  The Word add-in is the recommended way to add conditions. It handles spacing, bracket style, and paragraph vs. phrase mode automatically.
</Note>

***

## Full example

The following illustrates how phrase-level and paragraph-level conditions can work together in a single clause:

```text theme={null}
This Agreement is entered into by {%p if IsMarried %}the Parties, who are married to each other,{%p endif %}
{% if EntityType == "LLC" %}a limited liability company{% elif EntityType == "Corporation" %}a corporation{% endif %}
organized under the laws of the State of {{ State }}.

{%p if IncludeNDA %}

CONFIDENTIALITY. Each Party agrees to hold in strict confidence all information disclosed
by the other Party in connection with this Agreement.

{%p endif %}
```

In the generated document, the NDA paragraph either appears in full or is omitted entirely — with no blank line left in its place.
