Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish forms doc #463

Open
miloslavkostir opened this issue Feb 7, 2020 · 0 comments
Open

Publish forms doc #463

miloslavkostir opened this issue Feb 7, 2020 · 0 comments

Comments

@miloslavkostir
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant