> For the complete documentation index, see [llms.txt](https://inistate.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://inistate.gitbook.io/home/advanced/template.md).

# Template

## Type of Template mode

Template Feature in Inistate, which includes options like [**Simple**](#simple-mode-1) and **Code** modes for creating and customizing templates. Here's a detailed explanation of these modes:

{% tabs %}
{% tab title="Simple Mode" %}

* **What It Is**: A **user-friendly, drag-and-drop interface** for designing templates without requiring technical skills.
* **Who It’s For**: Ideal for users who prefer a quick and intuitive way to set up templates.
* **Features**:
  * Drag-and-drop elements like text, tables, images, or placeholders.
  * Customize colours visually.
  * Select from predefined layouts or styles.
  * Preview the design in real-time.
    {% endtab %}

{% tab title="Code Mode" %}

* **What It Is**: An **advanced mode** that allows users to write custom HTML, CSS, and dynamic placeholders to create highly customized templates.
* **Who It’s For**: Geared toward users with technical knowledge who want full control over the template design.
* **Features**:
  * Write HTML for layout customization.
  * Use CSS for styling (e.g., custom fonts, colors, spacing).
  * Embed placeholders (e.g., `{{Task Name}}`, `{{Due Date}}`) to pull dynamic data.
  * Add conditional logic (e.g., highlighting overdue tasks in red).
    {% endtab %}
    {% endtabs %}

### **How to Choose Between Modes**

* **Simple Mode**: If you need a quick, functional template with minimal customization.
* **Code Mode**: If you require advanced designs, branding, or dynamic features.

{% hint style="info" %}
**Code Mode** in the template feature require **basic programming skills, e.g. HTML,CSS**
{% endhint %}

## Simple Mode

### Element of Template (Simple Mode)

When designing a template in Inistate, several essential elements and options allow you to customize and design the formatted document for printing or exporting as a PDF. Here’s a breakdown:

### **Test Locus**

* This feature allows the user to select the **module** or **data source** they want to display in the document.
* Example: You can choose the **Tasks module**, **Bug Tracker**, or **Sales Pipeline** depending on what data you need to generate.

### **Design**

* Decide what items to include in the template. This is where you define the **fields, sections, and data points** to be displayed.
* Example:
  * Fields: Task Name, Status, Due Date, Assigned To.
  * Sections: Summary Table, Detailed Notes, or Comments.

### **Preview**

* Before finalizing the template, users can see a **live preview** of how the document will look with actual data.
* This step ensures that:
  * The layout is correct.
  * All fields are pulling the correct data.
  * Styling aligns with expectations.

### **Template Style**

* Users can select a **predefined style** for the document’s appearance. Different styles provide variety in formatting, such as:
  * Basic
  * Style 01
  * Style 02
  * Style 03

### **Dual-Tone Colour Style**

* Users can customize the document's **visual identity** by selecting:
  * **Primary Colour**: Often used for headers, titles, or key elements.
  * **Secondary Colour**: Used for highlights, separators, or background accents.
* Example:
  * Primary: Blue
  * Secondary: Gray

***

## **Summary of Key Features**

| Feature                    | Description                                                               |
| -------------------------- | ------------------------------------------------------------------------- |
| **Test Locus**             | Select the module or dataset to display in the document.                  |
| **Design**                 | Decide what fields and items to include in the template.                  |
| **Preview**                | View how the document will look before saving or finalizing the template. |
| **Template Style**         | Choose from predefined document styles for a professional appearance.     |
| **Dual-Tone Colour Style** | Customize the primary and secondary colours to match your branding.       |

## Usage

After designing a template, it is assigned as an Activity.

This allows you to perform the activity on any entry, enabling each entry to generate a PDF document by simply clicking the template activity you created.

The finalized PDF document can then be,

* **Downloaded**
* **Printed**

## **Example Use Cases**

1. **Task Summary**: Export a project update to share with stakeholders.
2. **Invoice**: Generate a detailed invoice with dynamic data for clients.
3. **Bug Report**: Print a formatted list of open issues for a team meeting.
