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

Last change on this file since 20597 was 20597, checked in by kjdon, 15 years ago

added _collectionspecificscript_ macro for collection specific javascript, this can be used instead of pagescriptextra - doesn't need to include any stuff for the local page

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