Skip to content

GridField seems to render GridFieldViewButton.ss template unnecessarily #11842

@GuySartorelli

Description

@GuySartorelli

In silverstripe/framework, the templates/SilverStripe/Forms/GridField/GridFieldViewButton.ss template is only used in very specific situations.

With silverstripe/frameworktest installed you can see the temoplate is used in the GridField at /admin/arbitrary-data.

Image

However, this template isn't normally used for the GridFieldViewButton. For example at /admin/test if you remove all buttons and add GridFieldViewButton a completely different button appearance is used - but the templates/SilverStripe/Forms/GridField/GridFieldViewButton.ss template still gets rendered out before being replaced.

Image

We shouldn't render out the template if we're not actually using it.

Ideally, there would also only be one template used to render out the view button even if it has multiple context-dependent representations - the context should be passed into the template and used as a condition to change what gets rendered.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions