> For the complete documentation index, see [llms.txt](https://docs.cw.crisisworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cw.crisisworks.com/security-and-support/technical-reference/merge-template-reference/tips-and-troubleshooting.md).

# Tips and Troubleshooting

Below are some tips to help when things don't work out right.

## General tips

* Start with our included [Additional CSS](/security-and-support/technical-reference/merge-template-reference/css-reference.md) and customise from there
* Most HTML tags require a matching opening and closing tag — use indenting to track them — e.g. align `<p>` and `</p>` and indent its content
* Use an HTML editor to avoid HTML coding mistakes
* Develop your layout first, and then insert your tokens
* Copy the tokens directly from the Merge Template form to save typos.

## Use CSS classes and semantic tags rather than inline styles

The system comes with a default set of CSS classes and semantic tags

* Structure your page with CSS classes (e.g. `right-box`, `left-box`) and semantic tags (`<article`>, `<address>`)
* Format your text using CSS classes (e.g. `center-text`, `warning-text`, `small-text`) and semantic tags (`<strong>`, `<em>`)

If you need to make changes to how these semantic styles look, these can be controlled in the Advanced CSS field of the merge template. You can also define further classes there.

While inline styles are possible (e.g. `<div style="color:red">` ), try to avoid them because they lead to inconsistencies and can also be blocked by our security subsystem.

## Using a local HTML editor for faster development

While building HTML templates can be difficult, it is possible to get a head start on your fixed layout by using an HTML code editor on your computer.

1. Use a code editor such as Visual Studio Code (free from Microsoft)
2. Create the HTML below to contain the structure of your page
3. Insert the [Base CSS](/security-and-support/technical-reference/merge-template-reference/css-reference.md) and [Additional CSS](/security-and-support/technical-reference/merge-template-reference/css-reference.md) into the document
4. Your template HTML lives within the `<body>` tag. Make all your changes there, and to your Additional CSS style. Do not edit the Base CSS or HTML outside of the body tag.
5. To preview a page, open the page in Google Chrome or Microsoft Edge and print to PDF.
6. Repeat steps 4 and 5 until you're happy with the results.
7. When done, copy all your HTML inside the `<body>` section into the HTML Template field of the merge template, and copy your Additional CSS into the Additional CSS field.

While this approach won't allow you to use the full template replacement and conditional logic features, it will allow you to quickly sort out most layout issues.

```html
<html>
<head>
    <style id="base">
        /* Insert the Base CSS stylesheet here */
    </style>
    <style id="additional">
        /* Insert the Additional CSS here, along with your own rules */
    </style>
</head>
<body>
    <!-- Insert your HTML here -->
</body>
</html>
```

## Troubles saving a merge template? It might be your HTML.

Sometimes you may receive a message "[Your item cannot be saved](/security-and-support/faqs/troubleshooting/system-administration/mail-merge-your-form-could-not-be-saved.md)" when trying to save a custom mail merge template.

This can be because our Web Application Firewall (WAF) monitors for "HTML injection" threats, and it has mistakenly detected a threat in your HTML/CSS.

If you encounter this issue, here's some things to check:

* Avoid inline styles, particularly those that try to insert hidden text or those that re-position text
* Keep your HTML template as simple as possible using semantic elements and classes
* Avoid defining styles using a `<style>` tag. If you need more CSS classes, you can define them in the Advanced CSS field instead.

{% hint style="info" %}
If you can't resolve the issue, send us a copy of your HTML via the service desk and we can help to resolve the issue.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cw.crisisworks.com/security-and-support/technical-reference/merge-template-reference/tips-and-troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
