Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] Allow to customize individual collection items in form themes #36039

Copy link
Copy link
Closed
@javiereguiluz

Description

@javiereguiluz
Issue body actions

Description
For some app I need to customize each item inside a CollectionType form field. We have {% block collection_row %}, {% block collection_widget %}, etc. But we don't have a {% block collection_entry %} and {% block collection_entry_row %}, {% block collection_entry_widget %}, etc.

At the end I needed to do this. It works, but it looks fragile:

{% block form_row %}
    {# ... #}

    {% set is_collection_item = block_prefixes|last ends with '_entry' %}

    {% if is_collection_item %}
        <div class="property-collection-item">
            {{ form_widget(form) }}
        </div>
    {% else %}
        {{ form_widget(form) }}
    {% endif %}
{% endblock %}

So, should we add support for these collection_entry_* blocks?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.