1

Is it possible to create a custom data source that does not include end user options? I have tried not including the getOptionsHtml(), returning null, returning an empty string, and just return and the all fail.

  • Just to be specific, I believe this question is about Sprout Forms for Craft 2. The getOptionsHtml method returns null by default and should display no options if you don't override it or return null yourself. What specific failure message are you getting? – Ben Parizek Jun 25 '18 at 16:50
1

A Custom Data Source does not require any settings. If desired, you could create a Data Source that only had a title and did whatever logic and queries that you wanted behind the scenes.

In Craft 2, getOptionsHtml returns null by default and shouldn't need to be set to anything in your Custom Data Source if that is desired:

public function getOptionsHtml()
{
    return null;
}

In Craft 3, the default is to not display any settings also:

public function getSettingsHtml()
{
    return null;
}

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.