0

開発が必要な新しい Grails Web アプリの UI とテーマをテストしています。

アプリでテーマ ゾーン ( http://grailsrocks.github.io/grails-platform-ui/guide/creatingThemes.html#themeRequiredZones )をオーバーライドできるかどうかを知りたいです。

テーマ レイアウトと UI セット テンプレート ( http://grailsrocks.github.io/grails-platform-ui/guide/advanced.html#advancedOverridingThemeLayouts ) が可能であることはわかっています。

私のテストアプリで具体的には、オーバーライドしたいと思います:

<theme:layoutTemplate name="header"/>
/grails-app/views/_themes/Bootstrap/_header.gsp

<theme:layoutZone name="navigation"/>
/grails-app/views/_themes/Bootstrap/default/_navigation.gsp

ここに私のConfig.groovyがあります:

compile ":platform-ui:1.0.RC3"
runtime ':bootstrap-theme:1.0.RC3'
grails.plugin.location.'grails-platform-ui-scaffolding' = "../grails-platform-ui-scaffolding"
4

1 に答える 1

0

platform-ui プラグインの次のバージョンでこれが修正されますhttps://github.com/MerryCoders/grails-platform-ui/pull/7

それまでの間、少なくとも layoutTemplate タグの回避策として使用されるカスタム TagLib を次に示します。

class OwnThemeTagLib extends org.grails.plugin.platform.ThemeTagLib {

def layoutTemplate = { attrs ->
    def templateView = grailsThemes.getRequestThemeTemplateView(request, attrs.name)

    // Location of app's standard content for theme layout templates
    // /grails-app/views/_themes/<ThemeName>/<templateName>
    def layoutTemplatePath = "/_themes/${templateView.owner}/${attrs.name}"

    // First see if the application provides default content for this template
    if (grailsViewFinder.templateExists(layoutTemplatePath)) {
        if (log.debugEnabled) {
            log.debug "Resolved current request's theme template for [${attrs.name}] to [${layoutTemplatePath}]"
        }
        delegate.out << g.render(template:layoutTemplatePath) 
    } else {
        if (log.debugEnabled) {
            log.debug "Resolved current request's theme template for [${attrs.name}] to [${templateView}]"
        }
        delegate.out << g.render(template:templateView.path, plugin:templateView.plugin)    
    }
}

}

于 2014-06-24T18:39:02.137 に答える