[36370] | 1 | name=Cascading Style Sheets<br/> Demo collection
|
---|
| 2 |
|
---|
| 3 | dls.Organization=Organizations
|
---|
| 4 | dls.Subject=Subjects
|
---|
| 5 | index_text=Text
|
---|
| 6 | index_document=Book
|
---|
| 7 | index_section=Chapter
|
---|
| 8 | dls.Title,Title=Titles
|
---|
| 9 | dls.Keyword=How to
|
---|
| 10 | depositormetadata={"name":"dls.Title","label":"Title","tooltip":"dls.Title: The title of this resource.","type":"text"}, {"name":"dls.Organization","label":"Organization","tooltip":"dls.Organization: The organization responsible for producing this resource.","type":"text"}, {"name":"dls.Subject","label":"Subject","tooltip":"dls.Subject: The subject of this resource.","type":"text"}, {"name":"dls.Keyword","label":"Keyword","tooltip":"dls.Keyword: A more specific indication of what the resource can be used for.","type":"text"}, {"name":"dls.Language","label":"Language","tooltip":"dls.Language: The language of this resource.","type":"text"}
|
---|
| 11 |
|
---|
| 12 |
|
---|
[36392] | 13 | shortDescription=<p>This collection demonstrates Greenstone's use of Cascading Style Sheets (CSS) for visual formatting in web browsers. On every page, you can change the style-sheet in effect, to modify that page's appearance. This collection contains the same material as the original Greenstone demo collection.</p>
|
---|
[36370] | 14 |
|
---|
[36392] | 15 | description1=<p>A combination of JavaScript and the overriding of GS3 XSL templates in Greenstone 3's <i>global</i> format statement is used by the collection to provide the stylesheet switching. As in some other <i>Documented Example Collections</i>, GLI's <pre>Format > Format Features > global</pre> can be used to define the <b>additionalHeaderContent</b> template. Doing so overrides the existing <i>additionalHeaderContent</i> template, and appends any specified HTML elements to the HTML header.</p>
|
---|
[36370] | 16 |
|
---|
[36392] | 17 | description2=<p>In this case, the <b>additionalHeaderContent</b> specifies the custom collection stylesheet currently active and the JavaScript to facilitate the stylesheet switching when a link is clicked. The <b>create-banner</b> XSL template in the <i>global</i> format statement is also overridden to provide links to the multiple stylesheets within the existing GS3 banner section, and invoke the custom JavaScript when any link is clicked. \n\
|
---|
| 18 | <pre> \n\
|
---|
| 19 | <xsl\:template name="additionalHeaderContent"> \n\
|
---|
| 20 | <xsl\:variable name="httpCollection"> \n\
|
---|
| 21 | <xsl\:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/> \n\
|
---|
| 22 | </xsl\:variable> \n\
|
---|
| 23 | <link rel="stylesheet" href="{$httpCollection}/style/gs3-style-default-extra.css" type="text/css" \n\
|
---|
| 24 | title="GS3 Style" id="custom-style" charset="UTF-8"/> \n\
|
---|
| 25 | \n\
|
---|
| 26 | <script src="{$httpCollection}/script/custom-script.js" type="text/javascript"> \n\
|
---|
| 27 | </script> \n\
|
---|
| 28 | \n\
|
---|
| 29 | </xsl\:template> \n\
|
---|
| 30 | \n\
|
---|
| 31 | \n\
|
---|
| 32 | <xsl\:template name="create-banner"> \n\
|
---|
| 33 | \n\
|
---|
| 34 | <div class="choose_style"> \n\
|
---|
| 35 | Choose a style\: \n\
|
---|
| 36 | <a href="#" onclick="replaceStyle('gs3-style-default-extra');return false;">Default Greenstone</a>, \n\
|
---|
| 37 | <a href="#" onclick="replaceStyle('gs3-style-blue');return false;">Blue</a>, \n\
|
---|
| 38 | <a href="#" onclick="replaceStyle('gs3-style-olive-purple');return false;">OlivePurple</a>, \n\
|
---|
| 39 | <a href="#" onclick="replaceStyle('');return false;">None</a> \n\
|
---|
| 40 | </div> \n\
|
---|
| 41 | \n\
|
---|
| 42 | <div id="gs_banner" class="ui-widget-header ui-corner-bottom"> \n\
|
---|
| 43 | <div id="titlesearchcontainer"> \n\
|
---|
| 44 | \n\
|
---|
| 45 | <xsl\:call-template name="page-title-area"/> \n\
|
---|
| 46 | <xsl\:call-template name="quick-search-area"/> \n\
|
---|
| 47 | <div style="clear\:both;"><xsl\:text> </xsl\:text></div> \n\
|
---|
| 48 | </div> \n\
|
---|
| 49 | <xsl\:call-template name="browsing-tabs"/> \n\
|
---|
| 50 | </div> \n\
|
---|
| 51 | </xsl\:template> \n\
|
---|
| 52 | </pre> \n\
|
---|
| 53 | </p>
|
---|
[36370] | 54 |
|
---|
| 55 | description3=<p>If you want to download any of these stylesheets for your own collections, here are links to them: \n\
|
---|
| 56 | <ul> \n\
|
---|
[36392] | 57 | <li><a href='https://trac.greenstone.org/browser/documented-examples/trunk/style-e/style/gs3-style-default-extra.css'>GS3 default extra</a> - builds on top of GS3's default style</li> \n\
|
---|
| 58 | <li><a href='https://trac.greenstone.org/browser/documented-examples/trunk/style-e/style/gs3-style-blue.css'>Blue theme</a> - modifies the GS3 default style for a blue colouring</li> \n\
|
---|
| 59 | <li><a href='https://trac.greenstone.org/browser/documented-examples/trunk/style-e/style/gs3-style-olive-purple.css'>olive-purple theme</a> - modifies the GS3 default style for a vivid colouring of vine green and purples</li> \n\
|
---|
| 60 | <li>None - clears all CSS styling from the current page (needs reload to get the default GS3 style back)</li> \n\
|
---|
[36370] | 61 | </ul> \n\
|
---|
| 62 | </p>
|
---|
| 63 |
|
---|
| 64 | description4=<p><b>Using a downloaded stylesheet</b> \n\
|
---|
| 65 | <ul> \n\
|
---|
[36392] | 66 | <li>To use a stylesheet as the default, place it in greenstone/web/interfaces/default/style and rename it to <pre>style.css</pre>. This will affect all collections.</li> \n\
|
---|
| 67 | <li>To use a stylesheet for a particular collection, place it in greenstone/web/sites/localsite/collect/<collection>/style then specify the stylesheet link in the <b>additionalHeaderContent</b> of GLI's <i>global</i> format statement (<pre>Format > Format Features > global</pre>) as follows: \n\
|
---|
| 68 | <pre><xsl\:template name="additionalHeaderContent"> \n\
|
---|
| 69 | <xsl\:variable name="httpCollection"> \n\
|
---|
| 70 | <xsl\:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/> \n\
|
---|
| 71 | </xsl\:variable> \n\
|
---|
| 72 | <link href="{$httpCollection}/style/stylesheet-name.css" rel="stylesheet" type="text/css"/> \n\
|
---|
| 73 | </xsl\:template></pre> \n\
|
---|
| 74 | </li> \n\
|
---|
[36370] | 75 | </ul> \n\
|
---|
| 76 | </p>
|
---|