New Feature: Allow views to specify a specific plugin layout in order to avoid conflicts
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
I have a Grails 3.1.10 plugin and application in a gradle multi-project with the following setup:
- Controller in the application that just render a view that is available in the plugin.
- The view in the plugin inherits from a layout also available in the plugin
- When I hit the url of the controller the layout is not applied (but the view is found and the data passed from the controller is rendered correctly)
### Expected Behaviour
The expected behaviour is that the layout from the plugin is applied. This works in Grails 2.3.6.
### Actual Behaviour
The layout is not applied although the view is rendered correctly (but without the layout)
### Environment Information
- **Operating System**: Linux Mint
- **Grails Version:** 3.1.10
- **JDK Version:** 1.8.0_101
- **Container Version (If Applicable):** tomcat running `grails run-app`
### Example Application
I've created a sample app that reproduces the problem: https://github.com/ilopmar/grails3-layout-and-view-plugin.
After cloning the repo:
```
cd myapp
grails run-app
```
And then open the browser and go to `http://localhost:8080/foo/index`
You will see the content of the plugin view but without the layout applied.
If now (without stopping the application) move the file `myplugin/grails-app/views/layouts/main.gsp` to myapp/grails-app/views/layouts/main.gsp` and reload the page, the layout is applied.
Contributor guide
Assessment
This issue has not been assessed yet.