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

checkbox field misses append and prepend #565

Open
drzraf opened this issue Apr 5, 2022 · 0 comments
Open

checkbox field misses append and prepend #565

drzraf opened this issue Apr 5, 2022 · 0 comments

Comments

@drzraf
Copy link
Contributor

drzraf commented Apr 5, 2022

As per https://learn.getgrav.org/17/admin-panel/extending#adding-a-custom-field, using prepend or append block.
But the checkbox field (and maybe others) overrides the whole input block without providing the same extension sub-blocks (namely prepend or append)

A somehow related problem is that create such an override (at <theme/templates/forms/fields/checkbox/checkbox.html.twig) simply containing:

{% extends "forms/fields/checkbox/checkbox.html.twig" %}

{% block label %}
foo
{% endblock %}

... basically kills PHP (probably triggering an infinite loop).
Not only no error message is logged in such situation but the advise (suggested in the above-mentioned documentation) to only extends forms/field.html.twig instead of a specific field's template, forces to copy/paste a lot of boiler-plate code what is clearly suboptimal.

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