<p>Just remove the <code>extends</code> and <code>set content</code>. The settings twig-code is rendered in a container inside the CP anyways:</p>

<pre><code>{% import "_includes/forms" as forms %}

&lt;p&gt;Hello Craft&lt;/p&gt;
</code></pre>

CC BY-SA 3.0
2016-10-05T08:26:18.490Z
Since I can't upvote your post I'll do it in this way, thank you very much.
Robin Schambach
CC BY-SA 3.0
2016-10-05T08:03:50.850Z
2016-10-05T08:03:50.850Z
KnutSv
<p>I'm trying to create a craft plugin but I have problems with rendering the settings.</p>

<p>Right now I used the same way like <a href="https://craftcms.com/docs/plugins/plugin-settings" rel="nofollow noreferrer">here</a> so this is my plugin code</p>

<pre><code>&lt;?php
namespace Craft;

class testPlugin extends BasePlugin
{


    function getName()
    {
        return Craft::t('Test');
    }

    public function getVersion()
    {
        return '0.1';
    }

    public function getDeveloper()
    {
        return 'Secondred Newmedia GmbH';
    }

    public function getDeveloperUrl()
    {
        return 'http://www.secondred.de';
    }

    public function getSourceLanguage()
    {
        return 'de';
    }

    protected function defineSettings()
    {
        return array(
            'accountID' =&gt; array(AttributeType::Mixed)
        );
    }

    public function getSettingsHtml()
    {
        return craft()-&gt;templates-&gt;render('test/tools/config', array(
            'settings' =&gt; $this-&gt;getSettings()
        ));
    }

    public function hasCpSection()
    {
        return false;
    }
}
</code></pre>

<p>And this is my config.twig</p>

<pre><code>{% extends "_layouts/cp" %}
{% import "_includes/forms" as forms %}

{% set page = 'Settings'|t %}
{% set title = 'Settings'|t %}

{% set content %}
    &lt;div class="pane"&gt;
        &lt;p&gt;Hello Craft&lt;/p&gt;
    &lt;/div&gt;

{% endset %}
</code></pre>

<p>But it always ends up like this 
<a href="https://i.sstatic.net/7QTWa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7QTWa.png" alt="enter image description here"></a>
The menu is always rendered inside my plugin Settings and If I just use </p>

<pre><code>public function getSettingsUrl()
{
    return 'test/tools/configuration';
}
</code></pre>

<p>the template is rendered correctly but I can't pass my variables anymore (of course in that example there are no, but I use some in my real plugin I just didn't want to show you 1000 lines of unneeded code) .</p>

<p>Could you please tell me what I'm doing wrong? My actual real plugin is nearly ready and this is the last error I have to fix but I don't know how. I need your help thank you very much.</p>

<plugin-development><templating><plugins><settings>
Plugin settings are rendered wrong
# Plugin settings are rendered wrong

(Asked by: username_0 on 2016-10-05)

I'm trying to create a craft plugin but I have problems with rendering the settings.
Right now I used the same way like here so this is my plugin code
 array(AttributeType::Mixed)
        );
    }

    public function getSettingsHtml()
    {
        return craft()->templates->render('test/tools/config', array(
            'settings' => $this->getSettings()
        ));
    }

    public function hasCpSection()
    {
        return false;
    }
}

And this is my config.twig
{% extends "_layouts/cp" %}
{% import "_includes/forms" as forms %}

{% set page = 'Settings'|t %}
{% set title = 'Settings'|t %}

{% set content %}
    
        Hello Craft
    

{% endset %}

But it always ends up like this 

The menu is always rendered inside my plugin Settings and If I just use 
public function getSettingsUrl()
{
    return 'test/tools/configuration';
}

the template is rendered correctly but I can't pass my variables anymore (of course in that example there are no, but I use some in my real plugin I just didn't want to show you 1000 lines of unneeded code) .
Could you please tell me what I'm doing wrong? My actual real plugin is nearly ready and this is the last error I have to fix but I don't know how. I need your help thank you very much.

**Tags:** plugin-development, templating, plugins, settings

---

## 1 answers

### Answer by username_1 on 2016-10-05. Score: 3 | Accepted answer

Just remove the extends and set content. The settings twig-code is rendered in a container inside the CP anyways:
{% import "_includes/forms" as forms %}

Hello Craft

> **Comments:**
> **username_0**: Since I can't upvote your post I'll do it in this way, thank you very much.  

---

