# Link do Manual

Pensando em deixar o link do manual do tema de maneira dinâmica, foi criado um novo item do lado do Studio e precisamos garantir que no arquivo `settings.html` funcione corretamente, para isso basta seguir o modelo abaixo.

{% hint style="info" %}
**Observação**

Esse item irá funcionar somente para o tema padrão 2.0 e temas derivados dele
{% endhint %}

Um input hidden será retornado dentro do Studio após a renderização. Ele poderá ser acessado pelo editor do tema usando o id `theme-docs-url`. Abaixo um exemplo de como o campo será retornado pelo Studio.

```html
<input id="theme-docs-url" type="hidden" name="theme-docs-url" value="https://link-manual.com.br">
```

No arquivo `settings.html`, no link do manual, devemos deixar o *href* sem o link, somente com o *#*

```html
<a id="doc-link" href="#" target="_blank" rel="noreferrer noopener">
   Manual do tema
</a>
```

E criar uma função para fazer a validação, conforme abaixo:

```javascript
setDocLink: function() {
    var docsUrl = $('#theme-docs-url').val();
    if (docsUrl && docsUrl.trim() !== '') {
         $('#doc-link').attr('href', docsUrl);
    }
},

// Inicia a função
this.setDocLink();
```

Com isso o link do manual funcionará perfeitamente de maneira dinâmica

{% hint style="info" %}
**Atenção!**

Lembre-se de validar os IDs e adaptar de acordo com o seu tema.
{% 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://partners.tray.com.br/themes/construindo-seu-template/editor-do-tema/editor/link-do-manual.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.
