> For the complete documentation index, see [llms.txt](https://academy.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.pentaho.com/pentaho-ctools/c-tools/community-dashboard-framework/cdf-dashboard.md).

# CDF Dashboard

{% hint style="info" %}
Asynchronous Module Definition (AMD) has modernized CDF's functionality. AMD is a JavaScript specification that provides an API for creating modular code with managed dependencies. Its key benefits include:

1. Asynchronous loading of interdependent modules
2. Logical organization of code into smaller, focused files
3. Better code structure and maintainability

CDF implements AMD through RequireJS, a JavaScript module loader that offers several advantages:

* **Namespace Protection**: By isolating code into modules, RequireJS prevents global namespace pollution, reducing the risk of function or variable name conflicts
* **Organized Code Structure**: Developers can arrange code across multiple folders and files
* **Smart Loading**: RequireJS handles asynchronous loading of dependencies while maintaining proper execution order

The workshops demonstrate RequireJS integration with CDF. While this approach also simplifies dashboard embedding in third-party applications (covered later), our current focus will be on basic dashboard creation.

The rewrite maintains the same information but presents it in a more structured and concise format, making it easier to understand the relationship between AMD, RequireJS, and CDF.
{% endhint %}

{% hint style="info" %}
To build a CDF dashboard, you need to create two main files that are mandatory:&#x20;

• XCDF: This is the main file that identifies the dashboard as a CDF dashboard type inside Pentaho. This is the file that identifies the dashboards inside Pentaho, and where the general settings are. For instance, we can set the name, template, and style for our dashboards. This file is written using the XML syntax.&#x20;

• HTML: This is the template file with HTML content where the components will be rendered.
{% endhint %}

x

x

{% tabs %}
{% tab title="XCDF" %}
{% hint style="info" %}
XCDF is the main file, where the root element and the following child elements are:
{% endhint %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<cdf>
  <title>My first dashboard!</title>
  <author>My Name</author>
  <description>My first dashboard!</description>
  <icon></icon>
  <template>myFirstDashboard.html</template>
  <style>clean</style>
  <require>true</require>
</cdf>
```

{% hint style="info" %}
• \<title>: This corresponds to the title displayed in the Pentaho User Console (PUC).&#x20;

• \<author>: This is the author of the file that will be displayed inside the user console. • \<description>: This is the description displayed in the PUC and on the browser.&#x20;

• \<icon>: This is the icon to be displayed.

{% endhint %}

x

x

x
{% endtab %}

{% tab title="HTML" %}

{% endtab %}
{% endtabs %}

x

x

x

x


---

# 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://academy.pentaho.com/pentaho-ctools/c-tools/community-dashboard-framework/cdf-dashboard.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.
