fields
fields copied to clipboard
/templates/_fields/_list.gsp is hardcoded
It is currently possible to override the default _table.gsp template but not the _list.gsp template.
Because of this I am forced to avoid scaffolding in a lot of situations that require minor modifications of the default template. Other users have already asked for a way to customize the behaviour of <f:display/> when only the bean is specified. See: https://github.com/grails-fields-plugin/grails-fields/issues/299 https://github.com/grails-fields-plugin/grails-fields/issues/298 https://github.com/grails-fields-plugin/grails-fields/issues/297 https://github.com/grails-fields-plugin/grails-fields/issues/271
Here is the existing code: https://github.com/grails-fields-plugin/grails-fields/blob/master/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy#L246
And here is the code that needs to be modified: https://github.com/grails-fields-plugin/grails-fields/blob/master/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy#L332 https://github.com/grails-fields-plugin/grails-fields/blob/master/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy#L869
I am able to edit the _list.gsp template file and it works great in all my projects for Grails 3 and Grails 4
Maybe the problem you are having is related to a particular fields version? I'm currently using v3.0.0 RC1 on grails 4 with my latest project
Here is where mine is /grails-app/views/templates/_fields/_list.gsp
@daptordarattler nice... but is this documented?
@aadrian has enhanced the tag to take a template
This template must still be located in /templates/_fields
but can be named anything.