fields icon indicating copy to clipboard operation
fields copied to clipboard

/templates/_fields/_list.gsp is hardcoded

Open valentingoebel opened this issue 5 years ago • 2 comments

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

valentingoebel avatar Nov 19 '19 13:11 valentingoebel

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 image

daptordarattler avatar Jan 20 '20 22:01 daptordarattler

@daptordarattler nice... but is this documented?

xpusostomos avatar Mar 31 '21 11:03 xpusostomos

@aadrian has enhanced the tag to take a template This template must still be located in /templates/_fields but can be named anything.

sbglasius avatar Jan 06 '24 17:01 sbglasius