# Post Template

### How does Templates work

Templates are lightweight objects containing the keys: `name`, `texture`, `model`, and `type`. Once registered, a template is displayed as a quick-access option for its specified type.\
\
Textures and models must be imported using both the [loadModel()](/nexo-maker-docs/main.js/api/loaders/load-model.md) and [loadAsset()](/nexo-maker-docs/main.js/api/loaders/load-asset.md) loaders.\
An example can be found in the links above.<br>

***

### Code Examples

```javascript
module.exports.init = async () => {
  
  const model = await nm.loadModel(
    __dirname + "/assets/mana_potion_small.json"
  );

  const texture = await nm.loadAsset(
    __dirname + "/assets/mana_potion_small.png"
  );

  nm.postTemplate({
    type: "create_item",
    model: model,
    texture: texture,
    title: "Mana Potion",
  });
};

module.exports.metadata = {
  id: "myexpansion",
  version: "0.1",
};

```

{% hint style="info" %}
Default types are: "create\_item", "create\_weapon", "create\_tool", "create\_food", "create\_block" and "create\_furniture"
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://nexo-maker.gitbook.io/nexo-maker-docs/themes/post-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
