# asset()

A função `asset()` é utilizada para referenciar o caminho absoluto do tema, com ele é possível incluir arquivos tais como, `css`, `javascript` e imagens.

{% hint style="info" %}
**Disponível em todas as páginas.**
{% endhint %}

### Como usar

Abaixo temos exemplos de como utilizar a função `asset()`.

Para isso, no seu código HTML, é necessário fazer a chamada do `asset()`, passando dentro dos parênteses as pastas do projeto até a origem do arquivo.

{% code title="Input" %}

```html
<img src="{{ asset('img/my-image.png') }}" alt="">
<script src="{{ asset('js/style.js') }}"></script>
<link rel="stylesheet" href="{{ asset('css/style.css') }}">        
```

{% endcode %}

Como retorno temos a `url` da loja, seu `id`, o `id` do tema e a pasta o arquivo desejado.

{% code title="Output" %}

```html
<img src="https://caminhoimg.com.br/1234/themes/111/img/my-image.png?1223" alt="">
<script src="https://caminhojs.com.br/1234/themes/111/js/style.js?1223"></script>
<link href="https://caminhoimg.com.br/1234/themes/111/css/style.css?1223">    
```

{% endcode %}

&#x20;


---

# 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://partners.tray.com.br/themes/construindo-seu-template/referencias/funcoes/asset.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.
