<p>Your settings page doesn't need to include <code>{% extends "_layouts/cp" %}</code>.</p>

<p>Also there's no need to define any block section. What's in your <em>template/settings.html</em> file will be shown within that CP-area per default.</p>

CC BY-SA 3.0
2015-05-07T16:28:48.110Z
I just tried to do the same, get rid of that "Save" button on a settings page. `redirect` sounded like a good suggestion but it didn't work for me, because it redirected each and every settings page with that set up (even settings/plugins !). Did you get that working or found another solution, @AlecRitson?
carlcs
CC BY-SA 3.0
2015-05-08T14:12:05.450Z
Hey @carlcs I dont think i did, in the end I just changed the way things were saved in the plugin to use the default settings form, i'd be interested in figuring this out though in the future for sure.
Alec Ritson
CC BY-SA 3.0
2015-05-08T14:25:03.120Z
@Alec I found out that it work if you use `setSettingsUrl` instead of `setSettingsHtml`. Stupid us ;)
carlcs
CC BY-SA 3.0
2014-10-28T12:43:05.367Z
Yeah you're right, the issue I have with this though is that it's wrapped in a form element with a save button at the bottom, this is something I want to avoid and I figured extending _layouts/cp would be the way to go about that.
Alec Ritson
CC BY-SA 3.0
2014-10-28T12:55:59.260Z
You _could_ use the `{% redirect %}` tag on your settings page and redirect the user to another page with your own custom settings. It's not super-fancy but it might work if you need to make something very custom...
naboovalley
CC BY-SA 3.0
2014-10-29T11:44:38.287Z
Thanks for your help, I think I will go down the redirect route, that way if I do end up needing settings it'll be easier to switch it out etc
Alec Ritson
CC BY-SA 3.0
2014-10-28T12:20:37.670Z
2014-10-28T12:20:37.670Z
naboovalley
<p>I'm aware that I could enable the plugin to have it's own CP section, but I don't feel that this would be the right place for it to live due to its nature, when you view the settings page it wouldn't be a list of inputs, it would be a table view.</p>

<p>Ideally the plugin page would reside in <code>settings &gt; plugins &gt; myPlugin</code> but have the same template as a plugin with a CP section, just like the sections settings page.</p>

<p>This is my template in <code>pluginHandle/settings.html</code></p>

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

{% set title = "My Plugin" %}

{% set content %}
  Some content should appear here maybe?
{% endset %}
</code></pre>

<p>I don't get any errors when I view the page it just looks like this:</p>

<p><img src="https://i.sstatic.net/KZDQi.jpg" alt="Plugin settings page"></p>

<p>As you can see the title variable gets ignored and has taken the plugin name, but if I remove the <code>{% set title = '' %}</code> part it throws an error of <code>Variable "title" does not exist</code>.</p>

<p>I tried to match the basics of what the sections settings template that craft has. Am I just trying to do something that was never an intended purpose or is just bad practice ?</p>

<p>Any clearance would be great, thanks!</p>

<plugin-development>
Can you extend "_layouts/cp" in a plugin settings page?
# Can you extend "_layouts/cp" in a plugin settings page?

(Asked by: username_0 on 2014-10-28)

I'm aware that I could enable the plugin to have it's own CP section, but I don't feel that this would be the right place for it to live due to its nature, when you view the settings page it wouldn't be a list of inputs, it would be a table view.
Ideally the plugin page would reside in settings > plugins > myPlugin but have the same template as a plugin with a CP section, just like the sections settings page.
This is my template in pluginHandle/settings.html
{% extends "_layouts/cp" %}
{% import "_includes/forms" as forms %}

{% set title = "My Plugin" %}

{% set content %}
  Some content should appear here maybe?
{% endset %}

I don't get any errors when I view the page it just looks like this:

As you can see the title variable gets ignored and has taken the plugin name, but if I remove the {% set title = '' %} part it throws an error of Variable "title" does not exist.
I tried to match the basics of what the sections settings template that craft has. Am I just trying to do something that was never an intended purpose or is just bad practice ?
Any clearance would be great, thanks!

**Tags:** plugin-development


---

## 1 answers

### Answer by username_1 on 2014-10-28. Score: 4 | Accepted answer

Your settings page doesn't need to include `{% extends "_layouts/cp" %}`.

Also there's no need to define any block section. What's in your *template/settings.html* file will be shown within that CP-area per default.

> **Comments:**
> **username_0**: Yeah you're right, the issue I have with this though is that it's wrapped in a form element with a save button at the bottom, this is something I want to avoid and I figured extending _layouts/cp would be the way to go about that.  
> **username_1**: You _could_ use the `{% redirect %}` tag on your settings page and redirect the user to another page with your own custom settings. It's not super-fancy but it might work if you need to make something very custom...  
> **username_0**: Thanks for your help, I think I will go down the redirect route, that way if I do end up needing settings it'll be easier to switch it out etc  
> **username_2**: I just tried to do the same, get rid of that "Save" button on a settings page. `redirect` sounded like a good suggestion but it didn't work for me, because it redirected each and every settings page with that set up (even settings/plugins !). Did you get that working or found another solution, @AlecRitson?  
> **username_0**: Hey @username_2 I dont think i did, in the end I just changed the way things were saved in the plugin to use the default settings form, i'd be interested in figuring this out though in the future for sure.  
> **username_2**: @Alec I found out that it work if you use `setSettingsUrl` instead of `setSettingsHtml`. Stupid us ;)  

---

