-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpost.groovy
More file actions
20 lines (17 loc) · 1.06 KB
/
post.groovy
File metadata and controls
20 lines (17 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import groovy.xml.slurpersupport.GPathResult
import groovy.xml.MarkupBuilder
void renderPage(Object pageData, GPathResult inXml, MarkupBuilder outXml, Map replacements){
GroovyShell shell = new GroovyShell()
def commons = shell.parse(new File('templates/.commons.groovy').text)
def pageProperties = commons.pageProperties(pageData, inXml, '/conf/sample/settings/wcm/templates/content-page','/apps/core/wcm/components/structure/page', replacements)
outXml.'jcr:root'(commons.rootProperties()) {
'jcr:content'(pageProperties) {
'root'(commons.component('wcm/foundation/components/responsivegrid')){
'responsivegrid'(commons.component('wcm/foundation/components/responsivegrid')){
'title'(commons.component('/apps/core/wcm/components/content/title', ['fontSize': 'h1', 'header': inXml.metadata.title.toString()]))
'text'(commons.component('/apps/core/wcm/components/content/text', ['textIsRich': true, 'text': inXml.content.toString()]))
}
}
}
}
}