summaryrefslogtreecommitdiff
path: root/docs/OnePageTutorial.html
blob: eaa9acc4a6d796f72dce7ed1f57e7a3416b3751b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
<!--  OnePageTutorial.html :  
      Originally this was Chuck Esterbrook's tutorial for his template
      maintainers.  Eventually this may expand into the future Cheetah
      Quick Reference or Beginners' Guide.
-->

<html>

<head>
<title>Cheetah Template One-Page Tutorial</title>

<style type="text/css">
<!--

/* Document-wide styles */

BODY {
	background-color: white;
}


/* Header styles */

TD.banner-top {
	background-color: #A43403;
}
TD.banner-bottom {
	background-color: #C75509;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			normal;
	font-size:				14px;
}
TD.banner-bottom-active {
	background-color: #C75509;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			normal;
	font-size:				14px;
}
TD.banner-bottom-inactive {
	background-color: #C75509;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			normal;
	font-size:				14px;
}
SPAN.banner-bottom-active {
	background-color:	#A43403;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			bold;
	font-size:				14px;
}
SPAN.banner-bottom-inactive {
	background-color:	#C75509;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			bold;
	font-size:				14px;
}



TD.banner-menu {
	background-color:	#A43403;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			normal;
	font-size:				14px;
}
SPAN.banner-menu {
	background-color:	#A43403;
	color:						#EFA84B;
	font-family:			sans-serif;
	font-weight:			bold;
	font-size:				14px;
}





/* Interface body styles */


A:link {
	color:						#00638E;
	font-family:			sans-serif;
	font-weight:			bold;
	text-decoration:	none;
}

/* A:visited */
/* A:active */

TD.action-header {
	color:        #7A311C;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight:	bold;
	font-size:		16px;
}

TD.body {
	color:				#C75509;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight:	normal;
	font-size:		14px;
}
SPAN.doc_title {
	color:				#666666;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight:	normal;
	font-size:		12px;
}

P.instructions {
	color:				#C75509;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight:	normal;
	font-size:		12px;
}


	/*
	 * Top level page
	 */

	body {
		font-family: Verdana, Arial, Helvetica, sans-serif;
		font-size: 80%;
		background-color: #FFFFFF;
		color: black;
	}

	p {
		font-family: Verdana, Arial, Helvetica, sans-serif;
		font-size: 12px;
		color: black;
	}

	table.banner {
		width: 100%;
	}

	td.bannerLogo {
		color: #FFA;
		background-color: orange;
		text-align: center;
		border: 2px solid #FFA;
		padding-left: 3px;
		padding-right: 3px;
		letter-spacing: -2px;
		white-space: nowrap;
		font-family: Arial, Helvetica, sans-serif;
		font-weight: bold;
		font-size: 18px;
	}

	td.bannerTitle {
		width: 95%;
		color: darkorange;
		text-align: center;
		font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
		font-weight: bold;
		font-size: 24px;
	}

	td.bannerStuff {
		text-align: right;
		white-space: nowrap;
		font-family: Arial, Helvetica, sans-serif;
	}

	a.bannerStuff {
		text-decoration: none;
	}

	a.bannerStuff:hover {
		text-decoration: underline;
	}

	span.pageFooter {
	}

	a.mainMenuLink {
		font-size: 175%;
	}

	.error {
		color: red;
	}

	/*
	 * Tab navigation
	 */

	tr.tabTop {
		font-size: 14px;
	}

	tr.tabBottom {
		background-color: #149;
	}

	td.activeTab {
		font-family: Arial, Helvetica, sans-serif;
		font-weight: bold;
		color: #FFA;
		background-color: #149;
	}

	td.inactiveTab {
		font-family: Arial, Helvetica, sans-serif;
		color: #FFA;
		background-color: #DEF;
	}

	a.activeTab {
		color: #FFA;
		text-decoration: none;
	}

	a.activeTab:hover {
		color: #FFA;
		text-decoration: underline;
	}

	a.inactiveTab {
		color: black;
		text-decoration: none;
	}

	a.inactiveTab:hover {
		color: black;
		text-decoration: underline;
	}

	/*
	 * Panels
	 */

	table.panel {
	}

	tr.panelTitle {
		font-weight: bold;
		background-color: lightblue;
	}

	td.panelTitle {
	}

	tr.panelBody {
		background-color: #EEEEEE;
	}


	/*
	 * Other
	 */

	table.ObjectBrowser {
	}

	tr.ObjectBrowser{
	}

	/* This is for a body row of the document list table */
	td.ObjectBrowserBody {
		background-color: #EEE;
	}

	/* This is for the header row of the document list table */
	td.ObjectBrowserHeader {
		background-color: #C6EFF7;
		font-weight: bold;
	}

	td.ObjectBrowserLink {
		background-color: #DEF3BD;
		font-weight: bold;
	}

	table.ObjectViewer {
	}

	tr.ObjectViewer {
	}

	/* This is for the name column of the object view table */
	td.ObjectViewerName {
		background-color: #C6EFF7;
		font-weight: bold;
	}

	/* This is for the value column of the object view table */
	td.ObjectViewerValue {
		background-color: #EEE;
	}

	/* This is for the info column of the object view table */
	td.ObjectViewerInfo {
		background-color: white;
	}

	table.ObjectEditor {
	}

	tr.ObjectEditor {
	}

	/* This is for the section label of the document edit table */
	td.ObjectEditorSection {
		background-color: #E6E6E6;
		font-weight: bold;
		font-size: 18px;
		color: #AC003B;
	}

	/* This is for the field name column of the document edit table */
	td.ObjectEditorName {
		background-color: white;
		font-weight: bold;
	}

	/* This is for the field value column of the document edit table */
	td.ObjectEditorValue {
		background-color: white;
	}

	/* This is for the info column of the object edit table */
	td.ObjectEditorInfo {
		background-color: white;
	}

	/* This is for the error column of the object edit table */
	td.ObjectEditorError {
		background-color: white;
		color: red;
		font-weight: bold;
		font-size: 12px;
	}


	/*
	 * Help
	 */

	blockquote.example {
		background-color: #EEE;
	}


	/*********************** from other site *********************/

	td.ColumnHeading {
		font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
		font-size: 150%;
		font-weight: bold;
		background-color: #FFFF77;
	}


	/*
	 * Sidebar
	 */

	span.SidebarHeading {
		font-weight: bold;
	}

	a.SidebarLink {
	}


	/*
	 * News
	 */

	span.NewsHeading {
		font-family: Tahoma;
		font-size: 14px;
		font-weight: bold;
	}


	/*
	 * Headings
	 */

	h1 {
		font-family: Arial, Helvetica;
		font-size: 14px;
		padding-top: 1em;
		padding-bottom: 0;
	}

	/*
	 * Other
	 */

	h2	{	font-family: Arial, Helvetica;
			font-size: 14px;
			color: darkblue;
			padding-top: 1em;
			padding-bottom: 0;
		}
	h3	{	font-family: Arial, Helvetica;
			font-size: 13px;
			padding-top: 1em;
			padding-bottom: 0;
		}
	h4	{	font-family: Arial, Helvetica;
			font-size: 12px;
			padding-top: 1em;
			padding-bottom: 0;
		}
	dl	{	padding-left: 2em;
		}
	ol	{	padding-left: 0.5em;
		}
	ul	{	list-style-type: disc;
			padding-left: 1.0em;
		}
	li	{	padding-top: 0em;
		}
	table {
		font-family: Verdana, Arial, Helvetica, sans-serif;
		font-size: 100%;
		color: black;
	}

-->
</style>

</head>

<body>

<h1>Cheetah Template One-Page Tutorial<BR>
<SMALL>By Chuck Esterbrook, now maintained by Mike Orr<BR>
Updated May 17, 2002</SMALL></h1>

<h2>Substitution</h2>

<p> The most commonly used templating feature is substitution:

<blockquote class=example><pre>
My name is $name
</pre></blockquote>

<p> You can use <i>dotted notation</i> to traverse objects. For example:

<blockquote class=example><pre>
$author.person.primaryEmail
</pre></blockquote>

<p> When a variable name is flush against other text you must use curly braces to separate it:

<blockquote class=example><pre>
Jim is a ${vice}maniac.
</pre></blockquote>

<p> However, the template language is savvy enough to handle sentence endings and variables:

<blockquote class=example><pre>
My name is $name.
$foo$bar
</pre></blockquote>


<h2>#if (conditional)</h2>

<p> The <i>#if</i> statement can be used to detect if a value is blank/undefined/NULL. The most common use for an #if statement is showing a different form of content if something is undefined.

<blockquote class=example><pre>
#if $keywords
    $keywords
#else
    There are no keywords!
#end if
</pre></blockquote>

<p> The #else part is optional:

<blockquote class=example><pre>
#if $keywords
    &lt;span class=keywords&gt;$keywords&lt;/span&gt;
#end if
</blockquote>


<h2>#for (looping)</h2>

<p> The <i>#for</i> statement is used to loop through any kind of list.

<blockquote class=example><pre>
#for $author in $authors
    $author.person.fullName
#end for
</pre></blockquote>


<h2>Combining statements</h2>

<p> You can combine statements. For example,

<p> Template.html:
<blockquote class=example><pre>
$name

&lt;p&gt; $content

#include "authors.html"
</pre></blockquote>

Authors.html:
<blockquote class=example><pre>
#if $authors
    &lt;table class=Author&gt;
    #for $author in $authors
        &lt;tr class=Author&gt; &lt;td class=Author&gt;
            $author
        &lt;/td&gt; &lt;/tr&gt;
    #end for
    &lt;/table&gt;
#end if
</pre></blockquote>


<h2>Examples</h2>

<p> Here is an example that lists several names and puts commas between them. Note the use of #slurp to slurp up extra whitespace that might interfere.

<blockquote class=example><pre>
#set sep = ''
#for $author in $authors
${sep}${author.person}#slurp
#set sep = ', '
#end for
</pre></blockquote>

</body>

</html>