> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/platform-documentation/other-help-articles/nodes-and-part-templates.md).

# Nodes and Part Templates

## Description

The system applies templates to nodes and parts to control the way they appear to users and end users. By default, parts print their output directly to the content buffer; for example, a text\_input part prints the caption followed by the html input control (\<input…>) to the content buffer and the web page generates from this buffer. It is possible, however, to control the printing with node and part templates, making it possible to do things like print the part caption to a specific div structure. If you use a part template, the system will write the specific output elements, such as caption and control, to variables.

## Elements

| Element                    | Description                                                                                                                                  |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| control                    | This is the main html output of the part. For text\_input parts this is the “\<input… />”.                                                   |
| caption                    | This is the interpolated version of the part caption parameter.                                                                              |
| prefix                     | This is the interpolated version of the part prefix parameter.                                                                               |
| postfix                    | This is the interpolated version of the part postfix parameter.                                                                              |
| validation                 | This is the message the system displays to the user when the first validation rule fails.                                                    |
| mandatory                  | This is ‘mandatory’ when you have enabled a mandatory validation rule. Otherwise, use ‘’.                                                    |
| additional\_info           | This relates to icons to indicate whether a Note or Photo is attached.                                                                       |
| reference                  | This is the icon to indicate resources references are linked to this part.                                                                   |
| validation\_mark           | This is ‘\*’ to indicate that the validation of this part failed.                                                                            |
| validation\_styles\_failed | This is a space-separated list of failed validation rules.                                                                                   |
| validation\_styles         | This is a space-separated list of configured validation rules.                                                                               |
| <…>                        | Any part parameter can be used in the template. Depending on the part implementation the parameter is modified, interpolated, or kept as is. |

## Examples of Predefined Templates

These are taken from the LogicNets Assessment Framework. ![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-293287853aa6fe2973220645b1b517b3021bc018%2F1e19401e-32b9-4ac5-b069-f53285aec053.png?alt=media)

## Set a Custom Part Template in a Framework

You can set a custom part template in a framework by creating a logicnet in the *onstart* folder and using the *set data object* part in a process node to ensure the system loads the template when initializing the application. When you do this, set *No Interpolate = YES*. When creating a custom part template, you can use one of the following approaches:

### Approach A: Create New Template Definitions and Reference them in Nodes/Parts

At the start of application development, you can define new templates and reference them either on the *Style* tab for form part templates or the *Details* tab for node templates. This maintains standard LogicNets templates but adds to the library of templates the application uses to display information.

### Approach B: Change Existing Template Definitions

This approach makes sense when you have built applications using standard LogicNets templates but want to add new/updated styling later in the application development cycle. Instead of editing every existing node to reference a new template, you can overwrite the standard definition by reusing the same name for the template but specifying an alternative DIV structure.

![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-5702882298acebe7a7fc07f7078cb87922b2b5f8%2Fc5b98a00-b0d6-4101-a1ee-ffb6bd0330f8.png?alt=media)

## Use a Part Template

* Define a template, for example:

  ```
  $(caption)
  $(control)
  ```
* Update the part parameter, using one of two options:
  * Define the template directly in the part declaration.

    ```
    { template = “
    $(caption)
    $(control)
    ”, … }
    ```
  * Store the template in a context variable.

    ```
    { template_ref = “part_template”, … }
    ```

## Use a Node Template

With node templates it is possible to mix the output of different parts of that node.

* Define a template, for example:

  ```
  { template_ref = “part_template”, … }
  ```
* Update the node parameters, using one of two options:
  * Define the template directly in node declaration.

    ```
    node = { template = “$(parts[1].caption)
    $(parts[1].control)$(parts[2].control)
    ”, … }
    ```
  * Store the template in a context variable.

    ```
    node = { template_ref = “node_template”, … }
    ```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/platform-documentation/other-help-articles/nodes-and-part-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
