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

Last change on this file since 12877 was 12491, checked in by mdewsnip, 18 years ago

Link and meta tags must be closed differently for HTML/XHTML validation. Added new "_compliance_", "_linktagend_" and "_metatagend_" macros for achieving this.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 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_pagescriptextra_ {}
27_pagebannerextra_ {}
28_pagefooterextra_ {}
29
30# it also relies on lots of Globals, the most important of these are:
31# _cookie_ - put in the cgi header
32# _globalscripts_ - javascript stuff
33# _imagecollection_
34# _imagehome_
35# _imagehelp_
36# _imagepref_
37# _imagethispage_ (this is now not an image, but text. should be renamed?)
38# _linkotherversion_
39
40# _httpiconchalk_ - the image down the left of the page - is now done
41# by the style sheet.
42
43_header_ {_cgihead_
44_htmlhead_(class="bgimage")_startspacer__pagebanner_
45}
46
47_header_[v=1] {_cgihead_
48_htmlhead__pagebanner_
49}
50
51# _cgihead_ {Content-type: text/html
52# _cookie_
53#
54# }
55_cgihead_{}
56
57# may be set in collection's extra.dm
58_collectionspecificstyle_ {}
59
60# any declarations relating to CSS that should go in the html head part.
61# declarations containing images are done here so the path is correct
62# at runtime.
63_cssheader_ {
64<link rel="stylesheet" href="_cssfilelink_" type="text/css"
65 title="Greenstone Style" charset="UTF-8" _linktagend_
66<link rel="alternate stylesheet" href="_httpimg_/style-print.css"
67 type="text/css" title="Printer" charset="UTF-8" media="print, screen" _linktagend_
68<link rel="stylesheet" href="_httpimg_/style-print.css" type="text/css"
69 title="Printer" charset="UTF-8" media="print" _linktagend_
70
71<style type="text/css">
72body.bgimage \{ background-image: url("_httpimg_/chalk.gif"); \}
73div.navbar \{ background-image: url("_httpimg_/bg_green.png"); \}
74div.divbar \{ background-image: url("_httpimg_/bg_green.png"); \}
75a.navlink \{ background-image: url("_httpimg_/bg_off.png"); \}
76a.navlink_sel \{ background-image: url("_httpimg_/bg_green.png"); \}
77a.navlink:hover \{ background-image: url("_httpimg_/bg_on.png"); \}
78p.bannertitle \{background-image: url("_httpimg_/banner_bg.png"); \}
79p.collectiontitle \{background-image: url("_httpimg_/banner_bg.png"); \}
80</style>
81_collectionspecificstyle_
82
83}
84
85# separate macro so it can be easily overridden for customised collections
86_cssfilelink_ {_httpimg_/style.css}
87
88# htmlhead uses:
89# _1_ - extra parameters for the body tag
90# _pagetitle_
91# _globalscripts_
92_htmlhead_ {<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
93
94<html_htmlextra_>
95<head>
96<title>_pagetitle_</title>
97<meta name="_status:textversion_" content="_versionnum_" _metatagend_
98_globalscripts_
99_cssheader_
100</head>
101
102<body _1_>
103}
104
105# Link and meta tags must be closed differently for HTML/XHTML validation
106_linktagend_ {_If_("_compliance_" eq "xhtml",/>,>)}
107_metatagend_ {_If_("_compliance_" eq "xhtml",/>,>)}
108
109_spacerwidth_ {65}
110
111# _startspacer_ is a spacer that gives pages a left-hand margin.
112# It must eventually be closed by _endspacer_.
113_startspacer_ {
114<div id="page">
115}
116
117# _bannertitle_ is defined in nav_css/ns4.dm, and is either text or
118# a banner image
119_pagebanner_ {
120<!-- page banner (\_style:pagebanner\_) -->
121<div id="banner">
122<div class="pageinfo">
123<p class="bannerlinks">_globallinks_</p>
124_bannertitle_
125</div>
126<div class="collectimage">_imagecollection_</div>
127</div>
128<div class="bannerextra">_pagebannerextra_</div>
129<!-- end of page banner -->
130}
131
132_pagebanner_[v=1] {
133<!-- page banner - text version [v=1] (\_style:pagebanner\_) -->
134<center><h2><b><u>_imagecollection_</u></b></h2></center><p>
135_globallinks_
136_pagebannerextra_
137<p>
138<!-- end of page banner -->
139}
140
141# note we no longer close off one of the startspacer tables here!!
142_footer_ {
143<!-- page footer (\_style:footer\_) -->
144_pagefooterextra__endspacer__htmlfooter_
145}
146
147# v=1 footer: not using startspacer in the header, so dont put it in the footer
148_footer_ [v=1]{
149<!-- page footer [v=1] (\_style:footer\_) -->
150_pagefooterextra_
151_htmlfooter_
152}
153
154# close off anything opened by startspacer
155_endspacer_ {
156</div> <!-- id=page -->
157}
158
159
160_htmlfooter_ {
161</body>
162</html>
163}
164
165# imagescript only used in nav_ns4.dm
166_globalscripts_{
167<script language="javascript" type="text/javascript">
168_If_(_pagescriptextra_,_pagescriptextra_)
169_imagescript_
170</script>
171}
172
173_globalscripts_ [v=1] {
174<script language="javascript" type="text/javascript">
175<!--
176_If_(_cgiargx_,_scriptdetach_)
177_pagescriptextra_
178// -->
179</script>
180}
181
182_scriptdetach_ {
183 function close\_detach() \{
184 close();
185 \}
186}
Note: See TracBrowser for help on using the repository browser.