# XML v2.0

As seen in the previous section, [](https://dev.ubidots.com/apps/custom-sidebar "mention"), XML v2.0 introduces a more modular and dynamic structure to the sidebar. The root `<tree>` now divides content into an optional set of `asidepanel` elements and a `body`, each with their own sections. The enhanced `asidepanel` supports dynamic content loaded via HTTP requests and [JSONPath parsing](https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html), enabling a more flexible and user-aware sidebar.

## XML Syntax

The custom sidebar uses XML to map UI elements to code, which is the engine that allows the creation of a sidebar tailored to a specific application.&#x20;

The available XML elements, and their hierarchy, are:

```
├── tree
│   ├── asidepanel
│   │   ├── (Option A: static)
│   │   │   └── section
│   │   │       ├── menu
│   │   │       │   └── item
│   │   │       ├── link
│   │   │       ├── text
│   │   │       └── divider
│   │   ├── (Option B: dynamic using attributes)
│   │   │   └── [HTTP source + query + path → resolved into link]
│   └── body
│       └── home
│       └── section
│           ├── menu
│           │   └── item
│           ├── link
│           ├── text
│           └── divider
```

Using these XML elements comes with rules that are enforced by the editor and warns you of errors in the syntax:

1. The XML needs to start with:\
   &#x20;`<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu XML V2.0//EN' "-">`.
2. The `<tree>` element is mandatory. It must have at least 1 `<body>` element. `<asidepanel>` is optional and there can be as many as needed.&#x20;
3. `<asidepanel>` can be static or dynamic, in which case the contents are loaded through HTTP and parse based on the element attributes.
4. The `<body>` must have at least 1 `<section>`.
5. `<section>` must have at least 1 `<menu>` or `<link>`.
6. `<menu>` must have at least 1 `<item>`.

Here's a quick summary of the available elements and their attributes, but you can click the links and read more details:

<details>

<summary>Summary of elements and their attributes</summary>

<table><thead><tr><th width="151.12890625" align="center">Sidebar element</th><th width="289.3671875" align="center">Description</th><th align="center">Attributes</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.</td><td align="center">–</td></tr><tr><td align="center"><a href="#asidepanel">asidepanel</a></td><td align="center">Allows creating static or dynamic asidepanels. This is an optional element within <code>&#x3C;tree></code></td><td align="center"><ul><li><strong>id:</strong> Used to associate the asidepanel with a <code>&#x3C;link></code> or <code>&#x3C;item></code> </li><li><strong>source:</strong> Path or URL from which dynamic content will be retrieved using HTTP.</li><li><strong>query:</strong> JSONPath expression to parse the response from source.</li><li><strong>path:</strong> This is the dynamic path template for each option in the asidepanel. It supports JSONPath.</li><li><strong>label:</strong> This is how the dynamic option will be shown in the asidepanel. It supports JSONPath.</li><li><strong>text:</strong> Title of the asipanel when open. It supports JSONPath.</li><li><strong>permissions:</strong> List of end-user permissions under which the asidepanel content will be visible.</li><li><strong>tags:</strong> List of end-user tags under which the asidepanel content will be visible.</li></ul></td></tr><tr><td align="center"><a href="#body">body</a></td><td align="center">Wraps all the content of the sidebar.</td><td align="center"><strong>–</strong></td></tr><tr><td align="center"><a href="#home">home</a></td><td align="center">This element controls the path or URL when clicking the application logo.</td><td align="center"><ul><li><strong>path:</strong> This the path or URL when clicking the logo. </li><li><strong>permissions:</strong> List of end-user permissions under which the home path will be applied.</li><li><strong>tags:</strong> List of end-user tags under which the home path will be applied.</li></ul></td></tr><tr><td align="center"><a href="#section">section</a></td><td align="center">Wraps all <code>link</code>, <code>menu</code>, <code>text</code> and <code>divider</code> elements. It creates a separation between sections with an optional title.</td><td align="center"><p> </p><ul><li><strong>text:</strong> Title of the section.</li><li><strong>permissions:</strong> List of end-user permissions under which the section is visible.</li><li><strong>tags:</strong> List of end-user tags under which the section is visible.</li></ul></td></tr><tr><td align="center"><a href="#menu-and-item">menu</a></td><td align="center">This is the dropdown menu.</td><td align="center"><ul><li><strong>defaultShow:</strong> [true | false] Determines whether the dropdown is open or closed when loading the app.</li><li><strong>icon:</strong> Name of icon from <a href="https://fontawesome.com/icons">Fontawesone</a>.</li><li><strong>iconFaType:</strong> [duotone | classic] Fontawesome type.</li><li><strong>iconFaStyle:</strong> [solid | regular | light | thin] Fontawesome style.</li><li><strong>label:</strong> Title of the menu</li></ul></td></tr><tr><td align="center"><a href="#menu-and-item">item</a></td><td align="center">Actual options displayed under a dropdown menu.</td><td align="center"><ul><li><strong>panelTarget:</strong> ID of the asidepanel. If present, path is ignored.</li><li><strong>path:</strong> Where the item redirects to upon clicking.</li><li><strong>label:</strong> Title of the item.</li><li><strong>open:</strong> Open link in same "tab" or  "redirect".</li><li><strong>exact:</strong> highlights the menulink when in the exact path defined by <strong>path</strong>.</li><li><strong>permissions:</strong> List of end-user permissions under which the item will be visible.</li><li><strong>tags:</strong> List of end-user tags under which the item will be visible.</li></ul></td></tr><tr><td align="center"><a href="#link">link</a></td><td align="center">Creates direct access to links.</td><td align="center"><ul><li><strong>panelTarget:</strong> ID of the asidepanel. If present, path is ignored.</li><li><strong>path:</strong> Where the link redirects to upon clicking.</li><li><strong>label:</strong> Title of the link.</li><li><strong>icon:</strong> Name of icon from <a href="https://fontawesome.com/icons">Fontawesone</a>.</li><li><strong>iconFaType:</strong> [duotone | classic] Fontawesome type.</li><li><strong>iconFaStyle:</strong> [solid | regular | light | thin] Fontawesome style.</li><li><strong>open:</strong> Open links in same tab or  redirect.</li><li><strong>exact:</strong> Highlights the menulink when in the exact path defined by <strong>path</strong>.</li><li><strong>permissions:</strong> List of end-user permissions under which the link will be visible.</li><li><strong>tags:</strong> List of end-user tags under which the link will be visible.</li></ul></td></tr><tr><td align="center"><a href="#text">text</a></td><td align="center">Creates text of different sizes. It helps in creating defined 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="#divider">divider</a></td><td align="center">Creates horizontal lines that serve as section separation.</td><td align="center">–</td></tr></tbody></table>

</details>

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

Parent element wrapping the `body` and the optionals  `asidepanel`:

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu XML V2.0//EN' "-">
<tree>
    <!--Your body and optionals asidepanel elements go here-->
</tree>
```

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

This element creates a static or dynamic, user-aware content asidepanel.&#x20;

{% hint style="info" %}

* Note that `asidepanel` can only be opened from a `link` or `item` element within a `body` `section`.
* A dynamic `asidepanel` panel has precedence over a static one, that is, if the "source" and "path" attributes are set, all elements inside the `asidepanel` will be ignored.
* Some attributes used in asidepanel support [JSONPath](https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html) expressions. This is used to parse the response when the asidepanel loads dynamic content from an HTTP request.
  {% endhint %}

These are the attributes of the `asidepanel` element:

<table><thead><tr><th width="120.1328125" align="center">Attribute</th><th>Description</th></tr></thead><tbody><tr><td align="center">id</td><td>Used to associate the asidepanel with the respective <code>link</code> or <code>item</code> elements from which the asidepanel will be invoked.</td></tr><tr><td align="center">source</td><td>Ubidots API endpoint path or external URL from which the content of the asidepanel will be retrieved dynamically through and HTTP request.</td></tr><tr><td align="center">text</td><td>This is the title of the asidepanel. It supports JSONPath expressions so it can change dynamically based on the HTTP request response to "source".</td></tr><tr><td align="center">query</td><td>JSONPath expression to parse the HTTP response from source. The evaluation of this expression should render a list of strings or objects used as the asidepanel options content.</td></tr><tr><td align="center">label</td><td>JSONPath expression used to select displaying label of the options in the asidepanel. This expression is evaluated over each list element from the "query" output. </td></tr><tr><td align="center">path</td><td>JSONPath expression used to build the path that each option will redirect to upon clicking. This expression is evaluated over each list element from the "query" output. </td></tr><tr><td align="center">permissions</td><td>Comma separated list of <a href="#permissions">permissions</a> associated with the path. An end user will only see the content of the asidepanel if its permissions match.</td></tr><tr><td align="center">tags</td><td>Comma separated list of <a href="#filter-elements-by-tags">tags</a>. This adds a visibility layer to the sidebar. An end user will only see the content of the asidepanel if its tags match. See also <a href="https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags">here</a>.</td></tr></tbody></table>

In the below 2 tabs are examples of how a static and a dynamic asidepanel look like, both in terms of XML code and UI. For simplicity, [permissions](#permissions) and [tags](#filter-elements-by-tags) aren't used in these examples, so refer to the respective sections to learn more about these 2 attributes.&#x20;

{% tabs %}
{% tab title="Static asidepanel" %}
This XML creates a fixed content asidepanel. In this mode, the asidepanel acts similarly to a `body` element, receiving `section`, `link`, `menu` and `item`, `text` and `divider` elements:

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu XML V2.0//EN' "-">
<tree>
  <asidepanel id="static-asidepanel">
    <section text="Static Internal Navigation">
      <text type="bold">Static panel with links and menus to resources</text>
      <link path="/app/dashboards/689619a3c9a12800114b6fbd" icon="home" label="Home"/>
      <menu icon="microchip" label="Device Management">
        <item path="/app/devices" label="All Devices" />
        <item path="/app/device-groups" label="Device Groups" />
        <item path="/app/device_types" label="Device Types" />
      </menu>
      <divider />
      <link path="/app/settings/" icon="cog" label="Settings" />
      <link path="/accounts/me/" icon="user" label="Profile" />
    </section>
  </asidepanel>
  <body>
    <section text="Main sidebar">
      <link panelTarget="static-asidepanel" icon="sidebar" label="Aside static"/>
      <menu defaultShow="true" icon="microchip" label="Devices">
        <item panelTarget="static-asidepanel" label="Aside static"/>
        <item path="/app/device-groups/" label="Group" />
        <item path="/app/device_types/" label="Types" />
      </menu>
    </section>
  </body>
</tree>
```

This will create a static asidepanel as follows. The options "Aside static" in the sidebar are, from top to bottom, the `link` and a `item` found in the `body` `section`.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FBXdfgLjoolmQ18yCcHxu%2FAside%20static%20from%20link%20and%20menuitem.png?alt=media&#x26;token=f7c577d5-4656-46a2-b805-286f7c0bda19" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Dynamic asidepanel" %}
This XML creates a dynamic-content asidepanel. In this mode, the asidepanel loads its user-aware content from an HTTP request, in this case to Ubidots dashboards API endpoint; Nonetheless, this could also be the URL from an [UbiFunction](https://dev.ubidots.com/ubifunctions) where custom logic is applied based on the user that's loading the asidepanel. It then uses its JSONPath enabled attributes to parse the response and render the asidepanel.&#x20;

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">
<tree>
  <asidepanel 
    id="dynamic-asidepanel"
    source="/api/v2.0/dashboards/"
    query="$.results[*]"
    label="$.name"
    path="/app/dashboards/{$.id}"
    text="Dynamic asidepanel"
  />
  <body>
    <section text="">
      <link path="/app/dashboards/" icon="home" label="Home"/>
      <link path="/app/dashboards/68c056ffe40f2600103af3ec/" icon="industry-windows" label="Production"/>
      <link path="/app/dashboards/" icon="chart-line-down" label="Losses"/>
      <menu defaultShow="true" icon="gear" label="Settings">
        <item path="/app/devices" label="Datasources"/>
        <item panelTarget="dynamic-asidepanel" label="Custom dashboards"/>
      </menu>
    </section>
  </body>
</tree>
```

This will create a dynamic asidepanel as follows. The `menuitem` option "Custom dashboards" in the sidebar invokes the HTTP to "/api/v2.0/dashboards/" and renders the dynamic content parsing the response with the respective attributes.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FJ66e9BqBzdfW5oYWDA4f%2FAside%20dynamic%20from%20menuitem.png?alt=media&#x26;token=b2ea5ef2-7a06-42dc-a369-e4607f493d79" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

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

Element wrapping the content of the sidebar.

{% hint style="info" %}

* The `body` must have at least 1 `section` element.
* The `body` element may have 0 or more `home` elements.
  {% endhint %}

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu XML V2.0//EN' "-">
<tree>
  <!--Your optionals asidepanel elements go here-->
  <body>
    <!--Your sections and optionals home elements go here-->
  </body>
</tree>
```

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

By default, clicking the application logo takes end-users to the dashboards module at "/app/dashboards/", usually to the last seen dashboard, nonetheless, by configuring this element, you can control the path or URL when clicking the application logo by user, using permissions and tags.

{% hint style="info" %}

* As an end-user, if the result of the permissions and tags filtering renders multiple `home` elements for that user, then clicking the logo takes to the dashboards module by default.&#x20;
  {% endhint %}

These are the attributes of the `home` element:

<table><thead><tr><th width="120.37890625" align="center">Attribute</th><th>Description</th></tr></thead><tbody><tr><td align="center">path</td><td>Redirection path (see available paths <a href="#permissions">here</a>) or URL.</td></tr><tr><td align="center">permissions</td><td>Comma separated list of <a href="#permissions">permissions</a> associated with the path. An end user will only see the effect of the <code>home</code> element if its permissions match.</td></tr><tr><td align="center">tags</td><td>Comma separated list of <a href="#filter-elements-by-tags">tags</a>. This adds a visibility layer to the sidebar. An end user will only see the effect of the <code>home</code> element if its tags match. See also <a href="https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags">here</a>.</td></tr></tbody></table>

The example below shows 2 `home` elements, each takes to a different dashboard. Note that by using tags, one is shown to User1, the other to User2 because the respective tags.&#x20;

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">

<tree>
  <body>
    <!-- Home for User1 with tag1 -->
    <home 
      path="/app/dashboards/663d484aaa8d92005751b2e2" 
      permissions="ubi_dashboards.view_dashboardpg" 
      tags="tag1"/>

    <!-- Home for User1 with tag2 -->
    <home 
      path="/app/dashboards/663d484aaa8d92007364jnhd" 
      permissions="ubi_dashboards.view_dashboardpg" 
      tags="tag2"/>

    <section text="Main Navigation">
      <link 
        label="Dashboard" 
        path="/dashboard" 
        icon="home.svg" 
        iconFaType="classic" 
        iconFaStyle="solid"/>
    </section>
  </body>
</tree>
```

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

This element creates groups of `menu`, `link`, `text` and `divider` elements within the sidebar or static asidepanel. The groups are separated by an optional text label.&#x20;

{% hint style="info" %}

* The `section` must contain at least one `menu`, `link`, `divider` or `text` element.
* The "text" attribute is mandatory. .
  {% endhint %}

These are the attributes of the `section` element:

<table><thead><tr><th width="120.01953125">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>text</td><td>Label/Title of the section.  It can be left empty, that is <code>text=""</code></td></tr><tr><td>permissions</td><td>Comma separated list of <a href="#permissions">permissions</a> associated with the path. An end user will only see the section if its permissions match.</td></tr><tr><td>tags</td><td>Comma separated list of <a href="#filter-elements-by-tags">tags</a>. This adds a visibility layer to the sidebar. An end user will only see the section if its tags match. See also <a href="https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags">here</a>.</td></tr></tbody></table>

Here's an XML example with 2 sections.&#x20;

{% columns %}
{% column width="58.333333333333336%" %}

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">
<tree>
  <body>
    <!-- First section -->
    <section text="Main Section">
      <link label="Dashboard" path="/dashboard" icon="home"/>
      <menu label="Reports" defaultShow="true" icon="newspaper">
        <menuitem label="Sales Report" path="/reports/sales"/>
        <menuitem label="Inventory Report" path="/reports/inventory"/>
      </menu>
    </section>
    
    <!-- Second section -->
    <section text="Settings Section">
      <link label="Profile" path="/settings/profile" icon="user"/>
      <menu label="Admin Tools" defaultShow="false" icon="gear">
        <menuitem label="User Management" path="/admin/users"/>
        <menuitem label="System Logs" path="/admin/logs"/>
      </menu>
    </section>
  </body>
</tree>
```

{% endcolumn %}

{% column width="41.666666666666664%" %}

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FhodzhPM8FK2o9rgzl3jq%2FMultiple%20sections.png?alt=media&#x26;token=a067f7c3-1de9-4a18-b149-59c398e6a6e6" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### <mark style="background-color:blue;">menu</mark> and <mark style="background-color:blue;">item</mark>

These 2 elements help create menus within the sidebar or static asidepanel.

{% hint style="info" %}

* A `menu` must have at least 1 `item`.
* As an end-user, if the result of the permissions and tags filtering renders an empty `menu`, then the menu won't be visible.&#x20;
  {% endhint %}

#### Attributes by element

{% tabs %}
{% tab title="menu" %}

<table><thead><tr><th width="123.0078125">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td>Label of the menu.</td></tr><tr><td>defaultShow</td><td>Determines whether the dropdown is open or closed when loading the app. <br>[true | false]</td></tr><tr><td>icon</td><td>Name of icon from <a href="https://fontawesome.com/icons">Fontawesone</a>.</td></tr><tr><td>iconFaType</td><td>Fontawesome type.<br>[duotone | classic]</td></tr><tr><td>iconFaStyle</td><td>Fontawesome style.<br>[solid | regular | light | thin]</td></tr></tbody></table>
{% endtab %}

{% tab title="item" %}

<table><thead><tr><th width="120.39453125">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td>Label of the item.</td></tr><tr><td>panelTarget</td><td>ID of the <a href="#asidepanel">asidepanel</a>. If present, path is ignored.</td></tr><tr><td>path</td><td>Redirection path (see available paths <a href="#permissions">here</a>) or URL.</td></tr><tr><td>exact</td><td>Highlights the item when in the exact path defined by path. It doesn't include the query parameters.<br>[true | false]</td></tr><tr><td>open</td><td>Open link in same tab or redirect.<br>[tab | redirect]</td></tr><tr><td>permissions</td><td>Comma separated list of <a href="#permissions">permissions</a> associated with the path. An end user will only see this item if its permissions match.</td></tr><tr><td>tags</td><td>Comma separated list of <a href="#filter-elements-by-tags">tags</a>. This adds a visibility layer to the sidebar. An end user will only see this item if its tags match. See also <a href="https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags">here</a>.</td></tr></tbody></table>

{% endtab %}
{% endtabs %}

Here's an example of a `menu` and its `items`.&#x20;

{% columns %}
{% column width="50%" %}

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">
<tree>
  <body>
    <section text="">
      <menu 
        label="Reports" 
        defaultShow="true" 
        icon="chart-bar" 
        iconFaType="duotone" 
        iconFaStyle="solid">
        <menuitem 
          label="Sales Report" 
          path="/app/data-analysis/reports/" 
          exact="true" 
          open="redirect"/>
        <menuitem 
          label="Inventory Report"
          path="/app/data-analysis/reports/" 
          exact="false" 
          open="tab"/>
        <menuitem 
          label="Customers Report" 
          path="/app/data-analysis/reports/" 
          exact="false" 
          open="tab"/>
      </menu>
    </section>
  </body>
</tree>
```

{% endcolumn %}

{% column width="50%" %}

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FusuuvsydN0D1cQiPCY3z%2Fmenu%20and%20item.png?alt=media&#x26;token=6626c569-2ff5-4ab9-a2fc-ae091d6144bc" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

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

This element creates direct links within the sidebar or static asidepanel.

These are the attributes of the `link` element:

<table><thead><tr><th width="120.56640625">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>label</td><td>Label of the menu.</td></tr><tr><td>panelTarget</td><td>ID of the <a href="#asidepanel">asidepanel</a>. If present, path is ignored.</td></tr><tr><td>path</td><td>Redirection path (see available paths <a href="#permissions">here</a>) or URL.</td></tr><tr><td>icon</td><td>Name of icon from <a href="https://fontawesome.com/icons">Fontawesone</a>.</td></tr><tr><td>iconFaType</td><td>Fontawesome type.<br>[duotone | classic]</td></tr><tr><td>iconFaStyle</td><td>Fontawesome style.<br>[solid | regular | light | thin]</td></tr><tr><td>exact</td><td>Highlights the item when in the exact path defined by path. It doesn't include the query parameters.<br>[true | false]</td></tr><tr><td>open</td><td>Open link in same tab or redirect.<br>[tab | redirect]</td></tr><tr><td>permissions</td><td>Comma separated list of <a href="#permissions">permissions</a> associated with the path. An end user will only see this link if its permissions match.</td></tr><tr><td>tags</td><td>Comma separated list of <a href="#filter-elements-by-tags">tags</a>. This adds a visibility layer to the sidebar. An end user will only see this link if its tags match. See also <a href="https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags">here</a>.</td></tr></tbody></table>

Here's an example of consecutive `link` elements

{% columns %}
{% column %}

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">
<tree>
  <body>
    <section text="Main Navigation">
      <link 
        label="Dashboards" 
        path="/app/dashboards/" 
        icon="objects-column" 
        iconFaType="classic" 
        iconFaStyle="solid" 
        exact="true" 
        open="redirect"/>
      <link 
        label="Reports" 
        path="/app/data-analysis/" 
        icon="newspaper" 
        iconFaType="duotone" 
        iconFaStyle="regular" 
        exact="false" 
        open="tab"/>
      <link 
        label="Settings" 
        path="/accounts/me/" 
        icon="gear" 
        iconFaType="classic" 
        iconFaStyle="light" 
        exact="true" 
        open="tab"/>
    </section>
  </body>
</tree>
```

{% endcolumn %}

{% column %}

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fw9o0oukKPDLEmEFcIZEv%2Flinks.png?alt=media&#x26;token=c0716ff2-9a59-41d5-88bc-da6cd725c731" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

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

Creates texts within the sidebar or static asidepanel.

These are the attributes of the `text` element:

<table><thead><tr><th width="119.84375">Attributes</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>Type of text<br>[h1 | h2 | h3 | h4 | normal | bold]</td></tr></tbody></table>

Here's an example of consecutive `text` elements with different types

{% columns %}
{% column width="58.333333333333336%" %}

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">
<tree>
  <body>
    <section text="Text Samples">
      <text type="h1">This is a Heading 1</text>
      <text type="h2">This is a Heading 2</text>
      <text type="h3">This is a Heading 3</text>
      <text type="h4">This is a Heading 4</text>
      <text type="normal">This is normal body text</text>
      <text type="bold">This is bold text</text>
    </section>
  </body>
</tree>
```

{% endcolumn %}

{% column width="41.666666666666664%" %}

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FsXwejk2ZQpujsZdkGjqZ%2Ftext.png?alt=media&#x26;token=9e1ab1b1-a5e2-4f80-8680-d0fdd516d9a8" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

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

Simply creates a horizontal line that introduces intentional separation. This element does not have any attributes

{% columns %}
{% column %}

```xml
<!DOCTYPE tree PUBLIC '-//UBIDOTS//DTD Menu App XML V2.0//EN' "-">
<tree>
  <body>
    <section text="Quick Menu">
      <link label="Home" path="/app/dashboards/" icon="home" iconFaType="classic" iconFaStyle="solid"/>
      <divider/>
      <link label="Profile" path="/accounts/me/" icon="user" iconFaType="duotone" iconFaStyle="regular"/>
    </section>
  </body>
</tree>
```

{% endcolumn %}

{% column %}

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FfNPeyqaeRskZy4arCIre%2Fdivider.png?alt=media&#x26;token=0c799255-6c75-4bc9-a6f0-16c0d4487971" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

## Permissions

The elements that support the permissions attribute will only appear to those end users whose assigned permissions match those of the element configuration.

The available permissions for each possible path that's exposed to the 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 elements that receive the "tag" attribute add a visibility layer on top of the permissions assigned to an end user. The way it works is by matching the tags of an end user with those specified in the respective element (learn [more about tag filtering](https://help.ubidots.com/en/articles/8063141-ubidots-basics-tags)). Simply put, if there's at least one match between the user tags and the element's, it means the element will be visible to the user.&#x20;

This filtering by tags allows customizing the sidebar based on the user accessing the platform. For example, say you want to create a direct link that takes users to their own home dashboard, you would create an XML as follows:

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

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

Let's assume 2 end users, with tags "tag1" and "tag2", respectively. Note that there are 2 home links in the XML, however, since they have different tags ("tag1" and "tag2"), each home link will appear to the respective user.

Likewise, this will preview the following sidebar. We have marked what each user would see:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FKjF575c9Kl9GTs3ESzo0%2FTags%20filtering.png?alt=media&#x26;token=41a569d0-3f23-4899-bb44-27db4fad7371" alt=""><figcaption></figcaption></figure>
