v2-docs
v2-docs copied to clipboard
Publish forms doc
There is wrong or poor documentation in example here https://docs.statamic.com/addons/publish-forms#example
- The
<publish fieldset="...">doesn't work This code:
<publish ...
fieldset="{{ $fieldset->toPublishArray() }}"
...
></publish>
throws:
ErrorException in helpers.php line 469:
htmlentities() expects parameter 1 to be string, array given (View:...)
- There is no explanation how to set addon's custom fieldset:
Path to fieldset:
site/addons/MyAddon/fieldsets/my_fieldset.yamlI was able to find inStatamic\CP\Fieldsethow to define fieldsets's (path)name:
private function prepareData($data)
{
return $this->preProcessWithBlankFields(Fieldset::get('MyAddon.fieldsets/my_fieldset', 'addon'), $data);
}
But I'm not able to define this fieldset in view. Code bellow doesn't work:
<publish ...
fieldset-name="MyAddon.fieldsets/my_fieldset" <!-- use either fieldset-name or fieldset props. not both -->
...
></publish>
Conclusion: If I'm creating publish form I'm creating addon too. But according to the documentation I can't use addon's fieldset. I must define fieldset in default /site/settings/fieldsets.