Creating a plugin that contains a custom field. I need to have some custom html for the settings of the field. I have the following in my field class:

 * @inheritdoc
public function getSettingsHtml()
    return Craft::$app->getView()->renderTemplate("src/templates/settings.html", [
        'field' => $this,

I have a "settings.html" in "src/templates".

What am I doing wrong?


Please read the docs (or this) about how to render plugin templates. It's all well explained there . You don't need to define src/templates but your plugin handle


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.