> For the complete documentation index, see [llms.txt](https://dev.ubidots.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ubidots.com/apps/custom-sidebar/xml-v1.0-deprecated.md).

# XML v1.0 (deprecated)

{% hint style="warning" %}
This XML version has been deprecated in favor of [XML v2.0](/apps/custom-sidebar/xml-v2.0.md).
{% endhint %}

XML v1.0 lets you customize the sidebar elements described below.

## XML syntax

The custom sidebar uses XML to map UI elements to code. This lets you create a sidebar tailored to a specific application.

The available UI elements and their hierarchy are:

```
├── tree
│   ├── menu
│   │   ├── toggle
│   │   │   ├── icon
│   │   │   ├── label
│   │   │   ├── chevron
│   │   ├── collapsable
│   │   │   ├── menulink
│   ├── link
│   │   ├── icon
│   │   ├── label
│   ├── paragraph
│   ├── divider
```

These XML elements follow rules enforced by the editor. The editor also warns you about syntax errors:

1. The XML needs to start with:\
   `<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V1.0//EN' "-">`
2. The `<tree>` element is mandatory. It must include at least one `<menu>` or `<link>` element.
3. The `<menu>` element must include at least one `<toggle>` and one `<collapsable>` element.
4. The `<collapsable>` element must include at least one `<menulink>` element.
5. The `<link>` element must include at least one `<icon>` and one `<label>` element.

Here's a quick summary of the available elements. Use the links for more detail:

<table><thead><tr><th width="178" align="center">Sidebar element</th><th align="center">Description</th><th align="center">Properties</th></tr></thead><tbody><tr><td align="center"><a href="#tree">tree</a></td><td align="center">Root element. All other elements must be inside it.</td><td align="center">–</td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">menu</a></td><td align="center">Creates dropdown menus.</td><td align="center"><ul><li><strong>defaultShow:</strong> Determines whether the dropdown is open or closed when the app loads.</li></ul></td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">toggle</a></td><td align="center">Defines the dropdown trigger.</td><td align="center"><strong>–</strong></td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">icon</a></td><td align="center">Represents the dropdown icon.</td><td align="center"><ul><li><strong>name:</strong> Name of an icon from <a href="https://fontawesome.com/icons">Font Awesome</a>.</li></ul></td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">label</a></td><td align="center">Text shown in the dropdown menu.</td><td align="center">–</td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">chevron</a></td><td align="center">Arrow icon shown in the dropdown menu.</td><td align="center">–</td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">collapsable</a></td><td align="center">Parent element for the options in the dropdown.</td><td align="center">–</td></tr><tr><td align="center"><a href="#menu-toggle-icon-label-chevron-collapsable-and-menulink">menulink</a></td><td align="center">Option shown under a dropdown menu.</td><td align="center"><ul><li><strong>path:</strong> Where the menulink redirects when clicked.</li><li><strong>permissions:</strong> List of end-user permissions under which the menulink is visible.</li><li><strong>tags:</strong> List of end-user tags under which the menulink is visible.</li><li><strong>open:</strong> Opens the link in the same tab or redirects.</li><li><strong>exact:</strong> Highlights the menulink when the current path exactly matches <strong>path</strong>.</li></ul></td></tr><tr><td align="center"><a href="#link">link</a></td><td align="center">Creates direct-access links.</td><td align="center"><ul><li><strong>path:</strong> Where the link redirects when clicked.</li><li><strong>permissions:</strong> List of end-user permissions under which the link is visible.</li><li><strong>tags:</strong> List of end-user tags under which the link is visible.</li><li><strong>open:</strong> Opens links in the same tab or redirects.</li><li><strong>exact:</strong> Highlights the link when the current path exactly matches <strong>path</strong>.</li></ul></td></tr><tr><td align="center"><a href="#paragraph-and-divider">paragraph</a></td><td align="center">Creates titles of different sizes. It helps define sections in the sidebar.</td><td align="center"><ul><li><strong>type:</strong> Determines the size. It can be "h1", "h2", "h3", "h4", "normal", or "bold".</li></ul></td></tr><tr><td align="center"><a href="#paragraph-and-divider">divider</a></td><td align="center">Creates horizontal lines that separate sections.</td><td align="center">–</td></tr></tbody></table>

### <mark style="background-color:blue;">tree</mark>

Parent element where all `<menu>` and `<link>` elements reside:

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V1.0//EN' "-">
<tree>
    <!--Your menulink and link components go here-->
</tree>
```

### <mark style="background-color:blue;">menu</mark>, <mark style="background-color:blue;">toggle</mark>, <mark style="background-color:blue;">icon</mark>, <mark style="background-color:blue;">label</mark>, <mark style="background-color:blue;">chevron</mark>, <mark style="background-color:blue;">collapsable</mark> and <mark style="background-color:blue;">menulink</mark>

Elements used to create dropdown menus:

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V1.0//EN' "-">
<tree>
    <menu defaultShow="true">
      <toggle>
        <icon name="gear"/>
        <label>Settings</label>
        <chevron/>
      </toggle>
    <collapsable>
      <menulink 
          open="tab"
          exact="false"
          path="/app/devices"
          tags="tag1"
          permissions="ubi_datasource.view_device"
        >Datasources
      </menulink>
      <menulink path="/app/dashboards/" tags="tag1" permissions="ubi_dashboards.view_dashboardpg">Custom dashboards</menulink>
    </collapsable>
  </menu>
</tree>
```

This creates a dropdown menu with its options:

<figure><img src="/files/2GIHbS6LdmDGIouF5nq3" alt="" width="563"><figcaption></figcaption></figure>

These are the properties of the `<menulink>` element:

<table><thead><tr><th width="140" align="center">Property</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">path</td><td align="center">Path in Ubidots to a direct resource, such as "/app/dashboards/663d484aaa8d92005751b2e2", a module such as "/app/dashboards/", or a full URL in Ubidots or on an external website.</td></tr><tr><td align="center">permissions</td><td align="center">Comma-separated list of <a href="#permissions">permissions</a> associated with the path. An end user only sees this menulink if the permissions match.</td></tr><tr><td align="center">tags</td><td align="center">Comma-separated list of <a href="#filter-elements-by-tags">tags</a>. This adds a visibility layer to the sidebar. An end user only sees this menulink if the tags match. See also <a href="https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags">here</a>.</td></tr><tr><td align="center">open</td><td align="center">Available options are:<br>- "tab": Opens the link in a new tab.<br>- "redirect": Opens the link in the same tab.</td></tr><tr><td align="center">exact</td><td align="center">"true" or "false". Highlights the menulink when the current path exactly matches <strong>path</strong>.<br><img src="/files/Ly9Lm2oIdjlPHdjgO9Kb" alt=""></td></tr></tbody></table>

### <mark style="background-color:blue;">link</mark>

Element used to create shortcuts, or direct access to modules or resources:

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V1.0//EN' "-">
<tree>
  <link
    open="tab"
    exact="true" 
    path="/app/dashboards/663d484aaa8d92005751b2e2" 
    tags="tag1" 
    permissions="ubi_dashboards.view_dashboardpg">
      <icon name="home"/>
      <label>Home</label>
  </link>
</tree>
```

This creates a direct link:

<figure><img src="/files/NAEWNV3Xw5Rq3NZRKyOD" alt=""><figcaption></figcaption></figure>

The properties of the `<link>` element are the same as those of `<menulink>`.

### <mark style="background-color:blue;">paragraph</mark> and <mark style="background-color:blue;">divider</mark>

Title or label element and horizontal separator.

```
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V1.0//EN' "-">
<tree>
    <paragraph type="bold">SECTION 1</paragraph>
    <divider/>
    <paragraph type="bold">SECTION 2</paragraph>
</tree>
```

This will create the following:

<figure><img src="/files/2vC2kERfEHCUlfHmcb49" alt="" width="498"><figcaption></figcaption></figure>

## Permissions

With permissions, the `<menulink>` and `<link>` elements only appear to end users whose assigned permissions match the element configuration.

The available permissions for each possible path exposed to end users in the application are:

<table><thead><tr><th width="173">Module</th><th width="241">Path</th><th>Permissions</th></tr></thead><tbody><tr><td>Devices</td><td>"/app/devices/"</td><td>"ubi_datasource.view_device"</td></tr><tr><td>Device groups</td><td>"/app/device-groups/"</td><td>"ubi_datasource.view_devicegroup"</td></tr><tr><td>Dashboards</td><td>"/app/dashboards/"</td><td>"ubi_dashboards.view_dashboardpg"</td></tr><tr><td>Events</td><td>"/app/events/"</td><td>"ubi_events.view_eventpg"</td></tr><tr><td>Reports</td><td>"/app/data-analysis/"</td><td>"ubi_data_analysis.view_report"</td></tr><tr><td>Organizations</td><td>"/app/organizations/"</td><td>"customuser.view_organization"</td></tr><tr><td>Users</td><td>"/app/organizations/users"</td><td>"customuser.view_user"</td></tr></tbody></table>

## Filter elements by tags

The `<menulink>` and `<link>` elements support a `tags` property that adds a visibility layer on top of the permissions assigned to an end user. This works by matching the user's tags with those specified in the `<menulink>` or `<link>` element (learn [more about tag filtering](https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags)). Simply put, if there is at least one match between the user's tags and the element's tags, the element is visible to the user.

Tag filtering lets you customize the sidebar based on the user accessing the platform. For example, if you want to create a direct link that takes users to their own home dashboard, create XML like this:

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V1.0//EN' "-">
<tree>
  <!--This link creates Home for User 1-->
  <link
    open="tab"
    exact="true" 
    path="/app/dashboards/663d484aaa8d92005751b2e2" 
    tags="tag1" 
    permissions="ubi_dashboards.view_dashboardpg">
      <icon name="home"/>
      <label>Home</label>
  </link>

  <!--This link creates Home for User 2-->
  <link
    open="tab"
    exact="true" 
    path="/app/dashboards/663d484aaa8d92007364jnhd" 
    tags="tag2" 
    permissions="ubi_dashboards.view_dashboardpg">
      <icon name="home"/>
      <label>Home</label>
  </link>
</tree>
```

Assume two end users with tags `tag1` and `tag2`, respectively. Note that there are two Home links in the XML. Since they use different tags, each Home link appears only to the matching user.

This previews the following sidebar. We have marked what each user would see:

<figure><img src="/files/G7BPDgtGQdFi4NRMJa31" alt="" width="563"><figcaption></figcaption></figure>


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dev.ubidots.com/apps/custom-sidebar/xml-v1.0-deprecated.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
