Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.3.5
-
Component/s: None
-
Labels:None
Description
In large grails projects, it's hard to find the template that actually renders the html.
Add a debug mode to render taglib so that it would output template name as html comments:
<!-- begin XX render template "_sometemplate.gsp" -->
content from template
<!-- end XX render template "_sometemplate.gsp" -->
there could be a identifier to match which begin and end comments are pairs.
debug mode should be configurable in Config.groovy .
Implemented in this commit: http://github.com/grails/grails-core/commit/8c5a3064696bed760e6027ac605e7b74296b5c43
Usage is simple: append "?debugTemplates" or "&debugTemplates" to the url and view the source of the result in your browser. There will be debug information about gsp templates used to render the page as html comments.
example:
<!-- GSP #2 START template: /home/lari/sampleapp/grails-app/views/_carousel.gsp precompiled: false lastmodified: 22.6.2010 10:45 -->
.
.
.
<!-- GSP #2 END template: /home/lari/sampleapp/grails-app/views/_carousel.gsp rendering time: 115 ms -->
Each block has a unique id (counter) inside the page so that you can find the start & end of each template call.
"debugTemplates" is restricted to development mode. It won't work in production.