Skip to content

Publish forms doc #463

@miloslavkostir

Description

@miloslavkostir

There is wrong or poor documentation in example here https://docs.statamic.com/addons/publish-forms#example

  1. 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:...)

  1. There is no explanation how to set addon's custom fieldset:
    Path to fieldset: site/addons/MyAddon/fieldsets/my_fieldset.yaml
    I was able to find in Statamic\CP\Fieldset how 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions