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

Last change on this file since 13370 was 13133, checked in by mdewsnip, 18 years ago

Languages that should be displayed right-to-left are now specified in style.dm, rather than in the C++ code (!).

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