gpc / fields

a spiritual successor to the bean-fields plugin
http://gpc.github.io/fields/
84 stars 106 forks source link

/templates/_fields/_list.gsp is hardcoded #305

Closed valentingoebel closed 8 months ago

valentingoebel commented 4 years ago

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 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

daptordarattler commented 4 years ago

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

xpusostomos commented 3 years ago

@daptordarattler nice... but is this documented?

sbglasius commented 8 months ago

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