source: gsdl/trunk/macros/style.dm@ 20316

Last change on this file since 20316 was 20316, checked in by davidb, 15 years ago

introduction of _optgloballinks_, similar to _optnavigationbar_, to allow optional placement of this structural element

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 5.3 KB
Line 
1# this file must be UTF-8 encoded
2#######################################################################
3# PAGE STYLES
4#######################################################################
5
6package Style
7
8# to use this style system output
9# _header_
10# all your page content, then
11# _footer_
12
13# use the page parameter 'style' to choose the appropriate style
14
15# Current values: "html" and "xhtml"
16_compliance_ {html}
17
18# the style system uses
19# _pagetitle_ - what gets displayed at the top of the browser window
20# _pagescriptextra_ - any extra javascript you want included in the header
21# _pagebannerextra_ - anything extra you want displayed in the page banner
22# _pagefooterextra_ - anything extra you want displayed in the footer
23
24# defaults for the above macros
25_pagetitle_ {_collectionname_}
26_pagescriptfileextra_ {}
27_pagescriptextra_ {}
28_pagebannerextra_ {}
29_pagefooterextra_ {}
30
31# it also relies on lots of Globals, the most important of these are:
32# _cookie_ - put in the cgi header
33# _globalscripts_ - javascript stuff
34# _imagecollection_
35# _imagehome_
36# _imagehelp_
37# _imagepref_
38# _imagethispage_ (this is now not an image, but text. should be renamed?)
39# _linkotherversion_
40
41# _httpiconchalk_ - the image down the left of the page - is now done
42# by the style sheet.
43
44_header_ {_cgihead_
45_htmlhead_(class="bgimage")_startspacer__pagebanner_
46}
47
48_header_[v=1] {_cgihead_
49_htmlhead__pagebanner_
50}
51
52# _cgihead_ {Content-type: text/html
53# _cookie_
54#
55# }
56_cgihead_{}
57
58# may be set in collection's extra.dm
59_collectionspecificstyle_ {}
60
61# any declarations relating to CSS that should go in the html head part.
62# declarations containing images are done here so the path is correct
63# at runtime.
64
65_csslink_{
66 <link rel="stylesheet" href="_cssfilelink_" type="text/css"
67 title="Greenstone Style" charset="UTF-8" _linktagend_
68 <link rel="alternate stylesheet" href="_httpstyle_/style-print.css"
69 type="text/css" title="Printer" charset="UTF-8" media="print, screen" _linktagend_
70 <link rel="stylesheet" href="_httpstyle_/style-print.css" type="text/css"
71 title="Printer" charset="UTF-8" media="print" _linktagend_
72}
73
74_cssheader_ {
75_csslink_
76<style type="text/css">
77body.bgimage \{ background: url("_httpimages_/chalk.gif") scroll repeat-y left top; \}
78div.navbar \{ background-image: url("_httpimages_/bg_green.png"); \}
79div.divbar \{ background-image: url("_httpimages_/bg_green.png"); \}
80a.navlink \{ background-image: url("_httpimages_/bg_off.png"); \}
81a.navlink_sel \{ background-image: url("_httpimages_/bg_green.png"); \}
82a.navlink:hover \{ background-image: url("_httpimages_/bg_on.png"); \}
83p.bannertitle \{background-image: url("_httpimages_/banner_bg.png"); \}
84p.collectiontitle \{background-image: url("_httpimages_/banner_bg.png"); \}
85</style>
86_collectionspecificstyle_
87
88}
89
90# separate macro so it can be easily overridden for customised collections
91_cssfilelink_ {_httpstyle_/style.css}
92
93# Languages that should be displayed right-to-left
94_htmlextra_ [l=ar] { dir=rtl }
95_htmlextra_ [l=fa] { dir=rtl }
96_htmlextra_ [l=he] { dir=rtl }
97_htmlextra_ [l=ur] { dir=rtl }
98_htmlextra_ [l=ps] { dir=rtl }
99_htmlextra_ [l=prs] { dir=rtl }
100
101# htmlhead uses:
102# _1_ - extra parameters for the body tag
103# _pagetitle_
104# _globalscripts_
105_htmlhead_ {<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
106"http://www.w3.org/TR/html4/loose.dtd">
107
108<html_htmlextra_>
109<head>
110<title>_pagetitle_</title>
111<meta name="_status:textversion_" content="_versionnum_" _metatagend_
112_globalscripts_
113_cssheader_
114_document:documentheader_
115</head>
116
117<body _1_>
118}
119
120# Link and meta tags must be closed differently for HTML/XHTML validation
121_linktagend_ {_If_("_compliance_" eq "xhtml",/>,>)}
122_metatagend_ {_If_("_compliance_" eq "xhtml",/>,>)}
123
124_spacerwidth_ {65}
125
126# _startspacer_ is a spacer that gives pages a left-hand margin.
127# It must eventually be closed by _endspacer_.
128_startspacer_ {
129<div id="page">
130}
131
132# _bannertitle_ is defined in nav_css/ns4.dm, and is either text or
133# a banner image
134_pagebanner_ {
135<!-- page banner (\_style:pagebanner\_) -->
136<div id="banner">
137<div class="pageinfo">
138<p class="bannerlinks">_optgloballinks_</p>
139_bannertitle_
140</div>
141<div class="collectimage">_imagecollection_</div>
142</div>
143<div class="bannerextra">_pagebannerextra_</div>
144<!-- end of page banner -->
145}
146
147_pagebanner_[v=1] {
148<!-- page ba
149nner - text version [v=1] (\_style:pagebanner\_) -->
150<center><h2><b><u>_imagecollection_</u></b></h2></center><p>
151_optgloballinks_
152_pagebannerextra_
153<p>
154<!-- end of page banner -->
155}
156
157# note we no longer close off one of the startspacer tables here!!
158_footer_ {
159<!-- page footer (\_style:footer\_) -->
160_pagefooterextra__endspacer__htmlfooter_
161}
162
163# v=1 footer: not using startspacer in the header, so dont put it in the footer
164_footer_ [v=1]{
165<!-- page footer [v=1] (\_style:footer\_) -->
166_pagefooterextra_
167_htmlfooter_
168}
169
170# close off anything opened by startspacer
171_endspacer_ {
172</div> <!-- id=page -->
173}
174
175
176_htmlfooter_ {
177</body>
178</html>
179}
180
181# imagescript only used in nav_ns4.dm
182_globalscripts_{
183_If_(_pagescriptfileextra_,_pagescriptfileextra_)
184<script language="javascript" type="text/javascript">
185_If_(_pagescriptextra_,_pagescriptextra_)
186_imagescript_
187</script>
188}
189
190_globalscripts_ [v=1] {
191<script language="javascript" type="text/javascript">
192<!--
193_If_(_cgiargx_,_scriptdetach_)
194_pagescriptextra_
195// -->
196</script>
197}
198
199_scriptdetach_ {
200 function close\_detach() \{
201 close();
202 \}
203}
Note: See TracBrowser for help on using the repository browser.