Changeset 38974 for documented-examples


Ignore:
Timestamp:
2024-05-02T13:11:19+12:00 (8 weeks ago)
Author:
kjdon
Message:

modified the description so that most of the HTML is not included in hte translatbale fragments

Location:
documented-examples/trunk/style-e
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • documented-examples/trunk/style-e/resources/collectionConfig.properties

    r38916 r38974  
    1 name=Cascading Style Sheets Demo
     1name=CSS Demo
    22textdate=publication date\:
    33textnumpages=no. of pages\:
     
    1313dls.Titles=Titles
    1414dls.Keyword=How to
    15 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"}
    1615
     16choose-style=Choose a style:
     17style.default=Default Greenstone
     18style.blue=Blue
     19style.olive=OlivePurple
     20style.none=None
    1721
     22style.extra=Default Greenstone Extra
    1823shortDescription=This collection demonstrates Greenstone's use of Cascading Style Sheets (CSS) for visual formatting in web browsers.
    1924
    2025description1a=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.
    2126
    22 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 <tt>Format &gt; Format Features &gt; global</tt> 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>
     27description1=<p>A combination of JavaScript and the overriding of XSL templates is used by the collection to provide the stylesheet switching. As in some other <i>Documented Example Collections</i>, GLI's <tt>Format &gt; Format Features &gt; global</tt> can be used to define the <b>additionalHeaderContent-collection</b> template. Doing so overrides the existing <i>additionalHeaderContent-collection</i> template, and appends any specified HTML elements to the HTML header. However, for this collection, we have chosen to add these templates to a custom header.xsl file, located in the collection's transform/layouts folder. Editing this file doesn't require reloading the collection in the library, which is needed if you edit collection formats in GLI.</p>
    2328
    24 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\
    25 <pre> \n\
    26   &lt;xsl\:template name="additionalHeaderContent"&gt; \n\
    27     &lt;xsl\:variable name="httpCollection"&gt; \n\
    28       &lt;xsl\:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/&gt; \n\
    29     &lt;/xsl\:variable&gt; \n\
    30     &lt;link rel="stylesheet" href="{$httpCollection}/style/gs3-style-default-extra.css" type="text/css"  \n\
    31        title="GS3 Style" id="custom-style" charset="UTF-8"/&gt; \n\
    32     &lt;script src="{$httpCollection}/script/custom-script.js" type="text/javascript"&gt; \n\
    33     &lt;/script&gt; \n\
    34   &lt;/xsl\:template&gt; \n\
    35  \n\
    36   &lt;xsl\:template name="create-banner"&gt;   \n\
    37     &lt;div class="choose_style"&gt; \n\
    38         Choose a style\: \n\
    39         &lt;a href="#" onclick="replaceStyle('gs3-style-default-extra');return false;"&gt;Default Greenstone&lt;/a&gt;, \n\
    40         &lt;a href="#" onclick="replaceStyle('gs3-style-blue');return false;"&gt;Blue&lt;/a&gt;, \n\
    41         &lt;a href="#" onclick="replaceStyle('gs3-style-olive-purple');return false;"&gt;OlivePurple&lt;/a&gt;,      \n\
    42         &lt;a href="#" onclick="replaceStyle('');return false;"&gt;None&lt;/a&gt; \n\
    43         &lt;/div&gt; \n\
    44     &lt;div id="gs_banner" class="ui-widget-header ui-corner-bottom"&gt;         \n\
    45       &lt;div id="titlesearchcontainer"&gt; \n\
    46     &lt;xsl\:call-template name="page-title-area"/&gt;   \n\
    47     &lt;xsl\:call-template name="quick-search-area"/&gt; \n\
    48     &lt;div style="clear\:both;"&gt;&lt;xsl\:text&gt; &lt;/xsl\:text&gt;&lt;/div&gt;     \n\
    49       &lt;/div&gt; \n\
    50       &lt;xsl\:call-template name="browsing-tabs"/&gt;   \n\
    51     &lt;/div&gt; \n\
    52   &lt;/xsl\:template&gt; \n\
    53 </pre> \n\
    54 </p>
     29description1b=<p>Note, the <i>additionalHeaderContent</i> template is defined in web/interfaces/default/transform/layouts/header.xsl, and it comprises 4 templates: <i>additionalHeaderContent-page</i>, <i>additionalHeaderContent-interface</i>, <i>additionalHeaderContent-site</i> and <i>additionalHeaderContent-collection</i>. These can be overridden at the page, interface, site and collection level, respectively. This allows fine grained tuning of the page headers.</p>
     30 
     31description2=<p>In this case, the <b>additionalHeaderContent-collection</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 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. </p>
    5532
    56 description3=<p>If you want to download any of these stylesheets for your own collections, here are links to them\: \n\
    57 <ul> \n\
    58 <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\
    59 <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\
    60 <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\
    61 <li>None - clears all CSS styling from the current page (needs reload to get the default GS3 style back)</li> \n\
    62 </ul> \n\
    63 </p>
     33description3=If you want to download any of these stylesheets for your own collections, here are links to them\:
     34description3a=builds on top of GS3's default style
     35description3b=modifies the GS3 default style for a blue colouring
     36description3c=modifies the GS3 default style for a vivid colouring of vine green and purples
     37description3d=clears all CSS styling from the current page (needs reload to get the default GS3 style back)
    6438
    65 description4=<p><b>Using a downloaded stylesheet</b> \n\
    66 <ul> \n\
    67 <li>To use a stylesheet as the default, place it in greenstone/web/interfaces/default/style and rename it to <tt>style.css</tt>. This will affect all collections.</li> \n\
    68 <li>To use a stylesheet for a particular collection, place it in <tt>greenstone/web/sites/localsite/collect/&lt;collection&gt;/style</tt> then specify the stylesheet link in the <b>additionalHeaderContent</b> of GLI's <i>global</i> format statement (<tt>Format &gt; Format Features &gt; global</tt>) as follows\: \n\
    69 <pre>&lt;xsl\:template name="additionalHeaderContent"&gt; \n\
    70     &lt;xsl\:variable name="httpCollection"&gt; \n\
    71       &lt;xsl\:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/&gt; \n\
    72     &lt;/xsl\:variable&gt; \n\
    73     &lt;link href="{$httpCollection}/style/stylesheet-name.css" rel="stylesheet" type="text/css"/&gt; \n\
    74 &lt;/xsl\:template&gt;</pre> \n\
    75 </li> \n\
    76 </ul> \n\
    77 </p>
     39description4=Using a downloaded stylesheet
     40description4a=To use a stylesheet as the default, place it in greenstone/web/interfaces/default/style and rename it to <tt>style.css</tt>. This will affect all collections.
     41description4b=To use a stylesheet for a particular collection, place it in <tt>greenstone/web/&lt;sitename&gt;/localsite/collect/&lt;collection&gt;/style</tt> then specify the stylesheet link in the <b>additionalHeaderContent-collection</b> of GLI's <i>global</i> format statement (<tt>Format &gt; Format Features &gt; global</tt>) as follows\:
  • documented-examples/trunk/style-e/transform/pages/about.xsl

    r38914 r38974  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<xsl:stylesheet version="1.0"
    3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">   
     3        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     4        xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
     5        xmlns:gslib="http://www.greenstone.org/XSL/Library">   
    46   
    57    <xsl:template name="coll-description">
    6       <p><xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItemList/displayItem[@name='description1a']"/></p>
     8      <p><gsf:collectionText name="description1a" propertyFile="collectionConfig"/></p>
    79     
    8       <xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItemList/displayItem[@name='description1']"/>
    9       <xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItemList/displayItem[@name='description2']"/>
    10       <xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItemList/displayItem[@name='description3']"/>
    11       <xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItemList/displayItem[@name='description4']"/>     
     10      <gsf:collectionText name="description1" propertyFile="collectionConfig"/>
     11      <gsf:collectionText name="description1b" propertyFile="collectionConfig"/>
     12      <gsf:collectionText name="description2" propertyFile="collectionConfig"/>
    1213     
     14      <pre>
     15  &lt;xsl:template name="additionalHeaderContent-collection"&gt;
     16    &lt;xsl:variable name="httpCollection"&gt;
     17      &lt;xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/&gt;
     18    &lt;/xsl:variable&gt;
     19    &lt;link rel="stylesheet" href="{$httpCollection}/style/gs3-style-default-extra.css" type="text/css" 
     20       title="GS3 Style" id="custom-style" charset="UTF-8"/&gt;
     21    &lt;script src="{$httpCollection}/script/custom-script.js" type="text/javascript"&gt;
     22    &lt;/script&gt;
     23  &lt;/xsl:template&gt;
     24 
     25  &lt;xsl:template name="create-banner"&gt;   
     26    &lt;div class="choose_style"&gt;
     27        Choose a style:
     28        &lt;a href="#" onclick="replaceStyle('gs3-style-default-extra');return false;"&gt;Default Greenstone&lt;/a&gt;,
     29        &lt;a href="#" onclick="replaceStyle('gs3-style-blue');return false;"&gt;Blue&lt;/a&gt;,
     30        &lt;a href="#" onclick="replaceStyle('gs3-style-olive-purple');return false;"&gt;OlivePurple&lt;/a&gt;,     
     31        &lt;a href="#" onclick="replaceStyle('');return false;"&gt;None&lt;/a&gt;
     32        &lt;/div&gt;
     33    &lt;div id="gs_banner" class="ui-widget-header ui-corner-bottom"&gt;         
     34      &lt;div id="titlesearchcontainer"&gt;
     35    &lt;xsl:call-template name="page-title-area"/&gt;   
     36    &lt;xsl:call-template name="quick-search-area"/&gt;
     37    &lt;div style="clear:both;"&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;/div&gt;   
     38      &lt;/div&gt;
     39      &lt;xsl:call-template name="browsing-tabs"/&gt;   
     40    &lt;/div&gt;
     41  &lt;/xsl:template&gt;
     42</pre>
     43
     44
     45      <p><gsf:collectionText name="description3" propertyFile="collectionConfig"/>
     46      <ul>
     47    <li><a href='https://trac.greenstone.org/browser/documented-examples/trunk/style-e/style/gs3-style-default-extra.css'><gsf:collectionText name="style.extra" propertyFile="collectionConfig"/></a> - <gsf:collectionText name="description3a" propertyFile="collectionConfig"/></li>
     48    <li><a href='https://trac.greenstone.org/browser/documented-examples/trunk/style-e/style/gs3-style-blue.css'><gsf:collectionText name="style.blue" propertyFile="collectionConfig"/></a> - <gsf:collectionText name="description3b" propertyFile="collectionConfig"/></li>
     49    <li><a href='https://trac.greenstone.org/browser/documented-examples/trunk/style-e/style/gs3-style-olive-purple.css'><gsf:collectionText name="style.olive" propertyFile="collectionConfig"/></a> - <gsf:collectionText name="description3c" propertyFile="collectionConfig"/></li>
     50    <li><gsf:collectionText name="style.none" propertyFile="collectionConfig"/> - <gsf:collectionText name="description3d" propertyFile="collectionConfig"/></li>
     51      </ul>
     52      </p>
     53
     54      <p><b><gsf:collectionText name="description4" propertyFile="collectionConfig"/></b>
     55<ul>
     56<li><gsf:collectionText name="description4a" propertyFile="collectionConfig"/></li>
     57<li><gsf:collectionText name="description4b" propertyFile="collectionConfig"/>
     58<pre>
     59&lt;xsl:template name="additionalHeaderContent"&gt;
     60    &lt;xsl:variable name="httpCollection"&gt;
     61      &lt;xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/&gt;
     62    &lt;/xsl:variable&gt;
     63    &lt;link href="{$httpCollection}/style/stylesheet-name.css" rel="stylesheet" type="text/css"/&gt;
     64&lt;/xsl:template&gt;</pre>
     65</li>
     66</ul>
     67</p>
     68
     69
     70      <xsl:call-template name="listCollFiles">
     71        <xsl:with-param name="file_list">etc/collectionConfig.xml;transform/layouts/header.xsl;script/custom-script.js</xsl:with-param>
     72      </xsl:call-template>
    1373    </xsl:template>
    1474
Note: See TracChangeset for help on using the changeset viewer.