1

I've been asked to theme a site for a team (just a few hours they said), but they're using Grails with SpringSource tool Suite. I'm not familiar with either.

When I look at the "proper" source, the theme source files don't exist, yet they get served. If I search for the files in the IDE, I get some stuff in .path_to_grails_plugin directory (which is not in source control). If I edit THERE, it picks up my changes, but that doesn't help the team... and I want to point to a NEW theme, not mess up the original one. The Target directory has some of the files, but not all, but isn't that where generated content goes? So where is the REAL source? This feels like the dark arts to me. I am clearly missing some fundamental knowledge about how this works.

I want to add a custom theme (theme-roller-generated), so I created a sub-folder for it in my web-app folder. Then, in my config.groovy file I put:

grails.resources.modules = {
    core {
        dependsOn 'jquery-ui'
    }
    // Define reference to custom jQuery UI theme
    overrides {
        'jquery-theme' {
             resource id: 'theme', url: '/css/theme-redo/jquery-ui-1.8.19.custom.css'
        }
    }
}

That doesn't do anything. It still serves the old css. Help me find the light!

  • 1
    Don't edit anything in `.path_to_grails_plugin directory`. It is not in source control for a reason. The files here are part of plugins. It seems like you don't have a very good grasp of what you need to do since you don't understand the underlying technology. First, I'd read a few tutorials about Grails http://grails.org/Documentation and then I'd ask this question again with some better background of what you need to do. – Andrew Eisenberg Apr 20 '12 at 21:04

2 Answers2

1

The CSS is stored in the web-app\css and the JavaScript is in the web-app\js directories. However, I high recommend going through some tutorials before moving stuff around by trial and error. Good luck!

Michael J. Lee
  • 12,278
  • 3
  • 23
  • 39
  • 1
    This is where I ended up putting my content, and it finally got picked up once the project got destroyed and re-created. It looks like the original setup was overriding some things that prevented this from automatically working. – Vibrant Ice Dec 05 '12 at 01:47
0

I've been running into the same problem. My workaround is to create another Resource module and include the theme there. It's an imperfect solution as the original unwanted theme css is still included - but it works.

ApplicationResources.groovy contains:

modules = {
    application {
        resource url:'js/application.js'
        resource url:'/css/smoothness/jquery-ui-1.8.20.custom.css'
    }
}

my.gsp contains:

<r:require modules="jquery, jquery-ui, application" /> 

ordering may be important..

keyser
  • 18,829
  • 16
  • 59
  • 101
bensfromoz
  • 11
  • 1