Multiple Grails Templates in One Application

I am building a grails DB web application for my company and find that I need to change the default backing templates.

So far so good, everything is generated using modified templates (controllers, views, ...).

Now, however, I am getting a request to create some “composite screens” with functions and layout that differ from the rewritten templates.

So now my question is: is it possible in grails to create one or more templates (the next by default) and pass this template name as an argument to the commands generate-*?

Thanks in advance!

EDIT: Adding a template name to the generation commands was just an idea, if it could be done in another way, I would be happy too.

+3
source share
2 answers

Grails commands are scripts in grails / scripts. If you follow your logic, you will see two things.

1) Only one parameter is passed to the script -> domain .

2) The class for generating views is DefaultGrailsTemplateGenerator. You can analyze the source code and check what this class offers.

Update

Link to DefaultGrailsTemplateGenerator on GitHub .

+2
source

I'm not sure about the options for generating the command, but if you add another .gsp page to the forest directory, I believe that it will try to launch it through the generation process.

, , show.gsp, showBasic.gsp, .

+2

Source: https://habr.com/ru/post/1759145/


All Articles