en:beginner:customization
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:beginner:customization [2016/06/24 02:35] – [Useful Links for Customisation] kjdon | en:beginner:customization [2023/03/13 20:51] (current) – [Customizations] kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
====== Customization ====== | ====== Customization ====== | ||
//**Part of the [[en: | //**Part of the [[en: | ||
Line 8: | Line 10: | ||
There are a few pages that, though not directly concerned with customization, | There are a few pages that, though not directly concerned with customization, | ||
can be very useful during the process: | can be very useful during the process: | ||
- | | + | < |
- | * Understanding how [[en:user:urls|Greenstone URLs]] work, including CGI arguments, can help you create links to various pages in your collection. | + | * Understanding how Greenstone URLs ([[en:user:gs3_urls|gs3]], [[en: |
* Knowing the [[en: | * Knowing the [[en: | ||
Line 16: | Line 18: | ||
- | <TABAREA tabs="Greenstone3, | + | =====Greenstone3===== |
- | < | + | ==== Site, interfaces, and libraries ==== |
- | ===== Site, interfaces, and libraries | + | |
Sites and interfaces contain the content and presentation information, | Sites and interfaces contain the content and presentation information, | ||
for the digital library. | for the digital library. | ||
Line 26: | Line 27: | ||
You can have multiple separate sites in a single Greenstone3 installation. | You can have multiple separate sites in a single Greenstone3 installation. | ||
- | An **[[en: | + | An **[[en: |
with a set of XSLT files used for translating XML output from the library into an appropriate form -- | with a set of XSLT files used for translating XML output from the library into an appropriate form -- | ||
HTML generally. XSLT (and therefore every Greenstone interface) is built around things called **templates**, | HTML generally. XSLT (and therefore every Greenstone interface) is built around things called **templates**, | ||
tell Greenstone how to display pages depending on the content for that page (e.g. a document' | tell Greenstone how to display pages depending on the content for that page (e.g. a document' | ||
the names of the collections in your site, what browsing classifier have been defined, etc.). | the names of the collections in your site, what browsing classifier have been defined, etc.). | ||
+ | |||
+ | A **library** is a combination of one site with one interface - in technical terms, each library is a servlet. | ||
+ | |||
+ | You can create any number of interfaces in your Greenstone3 installation, | ||
//If all of that sounds really confusing, don't worry! | //If all of that sounds really confusing, don't worry! | ||
Unless you want to make extreme changes to an interface (or define your own), | Unless you want to make extreme changes to an interface (or define your own), | ||
you can largely avoid XSLT. // | you can largely avoid XSLT. // | ||
+ | |||
+ | ==== Customizations ==== | ||
While the interfaces (i.e. the files that dictate how each page looks) themselves are separate from the content, you can override any part of | While the interfaces (i.e. the files that dictate how each page looks) themselves are separate from the content, you can override any part of | ||
Line 40: | Line 47: | ||
make modifying or overriding an interface easier: | make modifying or overriding an interface easier: | ||
* **[[en: | * **[[en: | ||
- | * **[[en: | + | * **[[en: |
* The GLI's **Format Features** section: The GLI provides an easy way to override parts of interface on a collection-level. Instead of having to create your own XSL files, you can type templates into the Format Features section of the Format panel. | * The GLI's **Format Features** section: The GLI provides an easy way to override parts of interface on a collection-level. Instead of having to create your own XSL files, you can type templates into the Format Features section of the Format panel. | ||
- | You can create any number of interfaces in your Greenstone3 installation, | + | ==== Useful Links==== |
- | present the same content in different ways. For example, you may want to provide two interfaces | + | |
- | for your sites: one interface for visitors using computers and another interface for mobile users. In addition, | + | |
- | multiple sites can make use of the same interface. | + | |
- | Finally, every site-interface combination you create is considered a **library** | + | |
- | (in technical terms, each library is actually | + | |
- | </TAB> | + | |
- | <!-- ################################################################################## | + | |
- | ####################################################################################### | + | * [[en: |
- | ####################################################################################### | + | * [[en: |
- | <TAB> | + | * [[en: |
- | ===== Collection level vs. library level ===== | + | |
+ | //**Now that you know the basics of using and customizing Greenstone, there are a few other features, functions, and resources you should be aware of. The final section of this Beginner' | ||
+ | |||
+ | =====Greenstone2===== | ||
+ | ==== Collection level vs. library level ==== | ||
Customization can be done at either collection level or library level. Any changes made in the GLI | Customization can be done at either collection level or library level. Any changes made in the GLI | ||
Line 62: | Line 70: | ||
enacted on a collection or library basis. | enacted on a collection or library basis. | ||
- | ===== Format Statements | + | ==== Format Statements ==== |
The //content// of a Greenstone collection is handled by [[en: | The //content// of a Greenstone collection is handled by [[en: | ||
which can be modified in the GLI (under '' | which can be modified in the GLI (under '' | ||
Line 68: | Line 76: | ||
to make changes. | to make changes. | ||
- | ===== Macros | + | ==== Macros ==== |
Greenstone2 is built on [[en: | Greenstone2 is built on [[en: | ||
a block of text or code. | a block of text or code. | ||
- | </ | ||
- | </ | ||
- | ===== Useful Links for Customisation ===== | + | ==== Maintaining security when customising GS2 macros ==== |
+ | |||
+ | A large part of Greenstone 2's security against cross-site scripting (XSS) is implemented in Greenstone 2.87+ in the macros files. This means that if you are customising it by reusing macros such as in new forms or paragraphs, you will need to be aware of how to do so in a secure way. | ||
+ | |||
+ | Every macro variable now has additional variants of itself: variants that are safe to use in an HTML context, in an HTML attribute context, CSS context, URL context, JavaScript context and SQL context. | ||
+ | |||
+ | The additional variants of each variable are denoted by the suffixes: | ||
+ | < | ||
+ | The variable name suffixes of these additional variants' | ||
+ | // | ||
+ | For example//, the '' | ||
+ | < | ||
+ | _cgiargqAttrsafe_ | ||
+ | _cgiargqCsssafe_ | ||
+ | _cgiargqUrlsafe_ | ||
+ | _cgiargqJssafe_ | ||
+ | _cgiargqSqlsafe_</ | ||
+ | |||
+ | In reusing existing macros when you want to customise Greenstone 2 macro files, carefully select the appropriate variant of the variable you want depending on the context in the file where that variable needs to be used. | ||
+ | |||
+ | In some cases, this can be straightforward: | ||
+ | |||
+ | An example of a more complex case would be where Javascript produces HTML. If the variable is part of the HTML page produced by some JavaScript code, you need to use the '' | ||
+ | |||
+ | If you make your customisations consciously and sensibly, your modified macro files will continue to keep Greenstone 2's security intact. | ||
+ | |||
+ | For more information: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | |||
+ | |||
+ | ====Useful Links ==== | ||
* [[en: | * [[en: | ||
- | * [[en:user:gs3_format_statements|Greenstone3 format | + | * [[en:user:gs2_format_statements|Format |
- | * [[en:user:gs3_list_of_format_options|Full list of Greenstone3 format options]] | + | * [[en:user:gs2_sample_format_statements| Sample |
- | * [[en: | + | * [[en:user:macros| Macros]] |
- | * [[en:user:themes|Greenstone3 Themes]] | + | * [[en:user:sample_macros|Sample |
- | * [[en:user:gs2_format_statements|Greenstone2 format statements]] | + | * [[en:user:collection_specific_macros|Collection specific |
- | * [[en: | + | |
- | * [[en:user:macros|Greenstone2 | + | |
//**Now that you know the basics of using and customizing Greenstone, there are a few other features, functions, and resources you should be aware of. The final section of this Beginner' | //**Now that you know the basics of using and customizing Greenstone, there are a few other features, functions, and resources you should be aware of. The final section of this Beginner' | ||
+ |
en/beginner/customization.1466735711.txt.gz · Last modified: 2016/06/24 02:35 by kjdon