<p>Consider using:</p>
<pre class="lang-php prettyprint-override"><code>return $this-&gt;asCpScreen()
            -&gt;title('dashboard')
            -&gt;contentTemplate('startupstirling/cp/charges/index');
</code></pre>
<p>removing blocks from your template so it's just the content:</p>
<pre><code>hello
</code></pre>

CC BY-SA 4.0
2022-12-13T21:29:06.450Z
2022-12-13T21:29:06.450Z
Leevi Graham
<p>First time building a custom control panel dashboard for a module.</p>
<p>Template loads ok but is unstyled and not loading JS that the rest of the control panel screens do.</p>
<pre><code>{% extends &quot;_layouts/cp&quot; %}
{% set title = &quot;Dashboard&quot;|t %}

{% block content %}
    hello
{% endblock %}
</code></pre>
<p>what have I missed from <a href="https://craftcms.com/docs/4.x/extend/cp-templates.html#page-templates" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/extend/cp-templates.html#page-templates</a></p>
<p>the controller for this looks like</p>
<pre><code>return Craft::$app-&gt;view-&gt;renderTemplate('module/cp/charges/index');
</code></pre>

CC BY-SA 4.0
2022-12-13T09:52:27.323Z
props to Leevi Graham who suggested doing return $this->asCpScreen()
            ->title('Charges')
            ->contentTemplate('module/cp/charges/index'); and works fine.
Steven Grant
<templating><modules>
extending the Craft control panel templates are unstyled
# extending the Craft control panel templates are unstyled

(Asked by: username_0 on 2022-12-12)

First time building a custom control panel dashboard for a module.
Template loads ok but is unstyled and not loading JS that the rest of the control panel screens do.
{% extends "_layouts/cp" %}
{% set title = "Dashboard"|t %}

{% block content %}
    hello
{% endblock %}

what have I missed from https://craftcms.com/docs/4.x/extend/cp-templates.html#page-templates
the controller for this looks like
return Craft::$app->view->renderTemplate('module/cp/charges/index');

**Tags:** templating, modules

> **Comments:**
> **username_0**: props to username_1 who suggested doing return $this->asCpScreen()             ->title('Charges')             ->contentTemplate('module/cp/charges/index'); and works fine.  

---

## 1 answers

### Answer by username_1 on 2022-12-13. Score: 3 | Accepted answer

Consider using:
return $this->asCpScreen()
            ->title('dashboard')
            ->contentTemplate('startupstirling/cp/charges/index');

removing blocks from your template so it's just the content:
hello


---

