<p>I overlooked the settings in composer.json to enable a settings page.</p>

CC BY-SA 4.0
2019-03-20T14:44:27.510Z
2019-03-20T14:44:27.510Z
Matt MacKenzie
<p>I have been staring at this all morning, comparing to other plugins online and cannot see why my plugin settings page never registers. I have verified the actual settings model is populated, but settingsHtml() is never called.</p>

<p>Anything obvious I have missed?</p>

<pre><code>class Storefront extends Plugin
{
    public static $plugin;
    public $schemaVersion = '1.0.1';
    public $hasCpSettings = true;
    public function init()
    {
        parent::init();
        self::$plugin = $this;

       $this-&gt;setComponents([
        'tracking' =&gt; TrackingService::class,
       ]);

        Event::on(
            Plugins::class,
            Plugins::EVENT_AFTER_INSTALL_PLUGIN,
            function (PluginEvent $event) {
                if ($event-&gt;plugin === $this) {
                }
            }
        );

        Craft::info(
            Craft::t(
                'storefront',
                '{name} plugin loaded',
                ['name' =&gt; $this-&gt;name]
            ),
            __METHOD__
        );
    }
    public function hasCpSection()
    {
        return false;
    }
    public function hasSettings()
    {
        return true;
    }
    protected function createSettingsModel()
    {
        return new Settings();
    }

    protected function settingsHtml(): string
    {
        return Craft::$app-&gt;view-&gt;renderTemplate('storefront/settings',
            [
            'settings' =&gt; $this-&gt;getSettings()
            ]
        );
    }
}
</code></pre>

CC BY-SA 4.0
2019-03-21T13:30:08.563Z
You could try generating your plugin framework via [pluginfactory.io](https://pluginfactory.io/) -- it'll make sure all of your i's are dotted and t's are crossed.
andrew.welch
<plugin-development><craft3><settings>
My plugin settings page is never loaded
# My plugin settings page is never loaded

(Asked by: username_0 on 2019-03-20)

I have been staring at this all morning, comparing to other plugins online and cannot see why my plugin settings page never registers. I have verified the actual settings model is populated, but settingsHtml() is never called.
Anything obvious I have missed?
class Storefront extends Plugin
{
    public static $plugin;
    public $schemaVersion = '1.0.1';
    public $hasCpSettings = true;
    public function init()
    {
        parent::init();
        self::$plugin = $this;

       $this->setComponents([
        'tracking' => TrackingService::class,
       ]);

        Event::on(
            Plugins::class,
            Plugins::EVENT_AFTER_INSTALL_PLUGIN,
            function (PluginEvent $event) {
                if ($event->plugin === $this) {
                }
            }
        );

        Craft::info(
            Craft::t(
                'storefront',
                '{name} plugin loaded',
                ['name' => $this->name]
            ),
            __METHOD__
        );
    }
    public function hasCpSection()
    {
        return false;
    }
    public function hasSettings()
    {
        return true;
    }
    protected function createSettingsModel()
    {
        return new Settings();
    }

    protected function settingsHtml(): string
    {
        return Craft::$app->view->renderTemplate('storefront/settings',
            [
            'settings' => $this->getSettings()
            ]
        );
    }
}

**Tags:** plugin-development, craft3, settings
> **Comments:**
> **username_1**: You could try generating your plugin framework via [pluginfactory.io](https://pluginfactory.io/) -- it'll make sure all of your i's are dotted and t's are crossed.  

---

## 1 answers

### Answer by username_0 on 2019-03-20. Score: 1

I overlooked the settings in composer.json to enable a settings page.


---

