Skip to content

Commit a217645

Browse files
committed
Added docs for r:stash
1 parent 1c314f0 commit a217645

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

grails-app/taglib/org/grails/plugin/resource/ResourceTagLib.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ class ResourceTagLib {
293293
needsResourceLayout()
294294

295295
def trk = request.resourceModuleTracker
296-
297296
def mandatory = attrs.strict == null ? true : attrs.strict.toString() != 'false'
298297
def moduleNames
299298
if (attrs.module) {

src/docs/ref/Tags/stash.gdoc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
h1. r:stash Tag
2+
3+
Using this tag you can write "inline" content anywhere in your GSP (providing you use Sitemesh layouts) and place into any disposition.
4+
5+
Corresponding [layoutResources|tags] can write these out.
6+
7+
This mechanism is used internally for inline [script|tags] invocations.
8+
9+
Currently only @script@ and @style@ types are supported.
10+
11+
{code:xml}
12+
<html>
13+
<head>
14+
<meta name="layout" content="main"/>
15+
</head>
16+
<body>
17+
<r:stash type="style" disposition="head-end">
18+
.ugly-inline-style { border: none; }
19+
</r:stash>
20+
21+
<r:stash type="script" disposition="middle">
22+
window.alert('This is same as r:script with disposition="middle"'');
23+
</r:stash>
24+
</body>
25+
</html>
26+
{code}
27+
28+
h2. Attributes
29+
30+
* type - Required. The type of the stash - values supported are "script" and "style"
31+
* disposition - Required. The disposition name to use for the stash.
32+
33+
34+
35+

0 commit comments

Comments
 (0)