Is it possible to disable the BootStrap of a grails plugin? - grails

In this post, it's described how to enable the BootStrap of a grails plugin: Is there an equivalent to the Bootstrap class in a Plugin.
If a 3rd party plugin has a BootStrap included in this way, is it possible to forcibly exclude MyPluginBootStrap, or at least prevent its execution?

Very straightforward solution - override it by creating bootstrap file with the same name in application (MyPluginBootStrap.grotovy in your case).

Related

grails 3.2.1 jquery ui

i'm new to grails and i have installed grails 3.2.1 in my system. i currently trying to install the jquery ui plugin
i followed the instruction given from the grails document. i have attached the link below.
https://grails.org/plugin/jquery-ui
finally i have found that "grails install-plugin" is depricated.
thing is i'm new to the grails 3 environment and i need a step by step instruction to install jquery ui.
thanks in advance.
That's the old Grails 2 plugin; there isn't and won't be a Grails 3+ plugin for jQuery or jQueryUI because there wasn't much value in using the plugins in Grails 2. Just do what you would do in any application - download whatever JavaScript, CSS, images, fonts, etc. you need to work with them directly.
Add them to the grails-app/assets folders and be sure to read the asset-pipeline plugin docs for information about packaging, bundling, minification, etc.

Grails 3 fields plugin custom templates

Is it possible to customize grails-plugin-fields templates to override default f:table and f:all templates?
I've tried placing a custom _table.gsp file inside my application grails-app/views/templates/_fields/ and src/main/templates/_fields/ but it doesn't works.
From the plugin source code seems that this is the right place to create this file.
I had the same problem with you. I worked it out by placing _table.gsp in /grails-app/views/templates/_fields/. I tried to place it in /src/templates/_fields/ but didn't work. Here's the proof.
I'm using grails 3.0.7 and testing this by using grails run-app command, by the way.
Cheers!

How to group JS and CSS using Grails asset-pipeline plugin?

I'm currently using the Grails resources plugin and I have many modules defined like this one:
bootstrap {
resource url:'js/libs/bootstrap/bootstrap.min.js'
resource url:'css/libs/bootstrap/bootstrap-responsive.css'
resource url:'css/libs/bootstrap/bootstrap-glyphicons.css'
resource url:'css/libs/bootstrap/bootstrap.min.css'
}
This is very convenient because it groups the Javascript and CSS files together into a single conceptual Bootstrap module.
I'm looking into the asset-pipeline plugin now, and it appears that files can only require other files of the same type, which means that I now have two trees of dependencies (CSS & JS) rather than one, which is a problem because there are interdependencies, e.g., bootstrap.js depends on bootstrap.css.
Does the asset-pipeline plugin allow for declaring inter-type dependencies? If not, what is the best way to deal with this issue?
I don't consider this as a problem. Organizing JS and CSS files separately (even though both belong to the same package/product such as Bootstrap) is a good thing and if the JS is not able to refer to the CSS, change the URI.
In my opinion, if you want to use Bootstrap with Grails, try twitter-boostrap.
Checkout my blog post regading Bootstrap CSS templating in Grails and if you want an example, checkout an project I did using Twitter Bootstrap here.

Grails Spring Security Login/Logout Controllers not generated

I am trying to learn Grails along with the Spring Security plugin. I am using Grails 2.3.0 with springsecurity-RC2 plugin and following the guide on the Grails website.
The issue I am running into is that the generated LoginController.groovy and LogoutController.groovy files from the s2-quickstart script are not being generated in the grails-app/controller, instead they are in target/work/springsecurity/grails-app/controller.
This issue does not seem to occur in grails 2.1.5 but does in 2.2.4.
Is there anyway for me to fix these issues or do I not need them?
This is by design. The files aren't generated anymore, they're included in the plugin itself. If you need to modify them, copy the controller and/or GSPs to your project in the same location under grails-app and make your changes there. Apps can always override plugin classes using this approach since Grails compiles plugins first, then the app.

Customize Grails generated views

Is it possible to customize code generated from grails create view command? for example can I use YUI or JQuery UI library for view code generation? Is there any sample for that?
Thanks,
Running the Grails command grails install-templates will copy into src/templates the template files used by all of the other Grails commands to generate files. You can then modify them however you wish.
Also, you may wish to look at some of the scaffolding plugins, such as Grails Twitter Bootstrap Scaffolding or Enhanced Scaffolding.

Resources