{"action":"opened","issue":{"url":"https://api.github.com/repos/ninsuo/symfony-collection/issues/34","repository_url":"https://api.github.com/repos/ninsuo/symfony-collection","labels_url":"https://api.github.com/repos/ninsuo/symfony-collection/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/ninsuo/symfony-collection/issues/34/comments","events_url":"https://api.github.com/repos/ninsuo/symfony-collection/issues/34/events","html_url":"https://github.com/ninsuo/symfony-collection/issues/34","id":163138010,"number":34,"title":"Can't add custom attr on collection_widget block","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-30T10:58:52Z","updated_at":"2016-06-30T10:58:52Z","closed_at":null,"body":"According to your twig doc header:\r\n\r\n```twig\r\n# If you are already using a form theme, you can use both by using:\r\n# {%\r\n#   form_theme myForm\r\n#       'FuzAppBundle::my-form-theme.html.twig'\r\n#       'FuzAppBundle::jquery.collection.html.twig'\r\n#       ...\r\n# %}\r\n```\r\n\r\nSo I did from config:\r\n\r\n```yaml\r\ntwig:\r\n    debug:            '%kernel.debug%'\r\n    strict_variables: '%kernel.debug%'\r\n    form_themes:\r\n        - 'form_generic_fields.html.twig'\r\n        - 'form_fields.html.twig'\r\n        - 'jquery.collection.html.twig'\r\n```\r\n\r\nAnd in `form_generic_fields.html.twig`, I want to always add `collection-type` class like this:\r\n\r\n```twig\r\n{% block collection_widget -%}\r\n    {% set attr = attr|merge({class: (attr.class|default('') ~ ' collection-type')|trim}) %}\r\n    {{ parent() }}\r\n{%- endblock collection_widget %}\r\n```\r\n\r\nThe problem is this as no effect at all because your template also override this block and don't have any parent.\r\n\r\nIs that a solvable issue or should I do it with another way?"}}
{"actor":{"display_login":"Soullivaneuh"}}