After installing the extension you have to do folllowing steps:
include the static extension template in your main TypoScript template setup:
Include static (from extensions) -> Accessibility Glosary (a21glossary)
switch to Template -> Constant Editor, choose the category “A21GLOSSARY”
if you want to use the frontend glossary list, define at least the “Frontend glossay page” ID; if you have several sites in one installation, you should also define the storage page ID of the glossary entries of the current site
create the plugin record “Glossary” on the frontend glossary page, if necessary
feel free to change / adapt the constant and setup configurations – it is only an example.
Only page sections wrapped with <!-- A21GLOSSARY_begin--> <!-- A21GLOSSARY_end--> will be processed. If no such comments are found the whole page will be processed.
TypoScript reference of the replacing engine. This engine replaces all occurances of glossary words on the website with their explaining markup. So the word is wrapped in some HTML tags, e.g. <acronym lang=”en” title=”North Atlantic Treaty Organisation”>NATO</acronym> is inserted instead of NATO, if the glossary contains such an entry. This configuration is part of the global configuration object “CONFIG”.
CONFIG
Property: | Data type: | Description: | Default: |
|---|---|---|---|
tx_a21glossary | -->tx_a21glossary | all replacing configurations of this extension |
[tsref:config/->CONFIG]
tx_a21glossary
Property: | Data type: | Description: | Default: |
|---|---|---|---|
pidList | list of page_id or string 'pagetree' | page ID list, where the glossary records stored; by default all entries on all pages are used for replacement; 'pagetree' -> only the the pages in the current pagetree | all pages |
excludePages | list of page_id / array of pages | 1) Page numbers wich are excluded from the replacing process. The prominent example is the glossary list page by itself. 2) list of exclude types for a certain page: excludePages.[pageID] = abbr, dfn The pageID must be one of the pages from the excludePages list (1) See also the next point “excludeTypes” | |
excludeTypes | list of strings | List of replacing types wich should not be processed, even if there are glossary entries with them. A type is a HTML element wich will be inserted on replacement, e.g. acronym, abbr, dfn, q etc. | |
ExcludeTags | List of strings | List of tags which shouldn't be processed e.g. H1,H2 | |
includePagetypes | list of pagetypes | List of PageTypes (set through the typeNum property of the 'page' object), which should be processed. If none is given, all pagetypes will be processed | type=0 (normal) |
caseSensitiv | boolean | If set to 1, the glossary entries will be replaced only if the character case is identical with the appropriate page content words. | 0 |
patternModifiers | string | PCRE / Regex pattern modifiers: http://php.net/manual/reference.pcre.pattern.modifiers.php e.g. /us for utf-8 based character processing and avoiding new lines within patterns | s |
patternModifiersLink | string | alternative regex pattern modifiers for strings wich schould wrapped in a link | |
debug | boolean | If set to 1, MySQL error messages will be displayed with further MySQL debugging information | 0 |
linkExcludeTags | List of strings | List of tags within no linking will be done | a |
linkToGlossary | list of strings | List of replacing types (=HTML elements), wich will be wrapped in a link to the glossary page. For example, if you use following types: acronym, abbr and dfn and set this configuration: linkToGlossary = acronym,dfn then only these two glossary record types will be wrapped in a link to the glossary; the abbr element will not be linked. Additionally the typolink section must be configured also, see below. | none |
linkOnlyIfNotEmpty | list of strings | List of database fields, wich must not be empty in a record, if a link to the glossary entry should be added to this word. Only if all of them are empty, the link is not created (OR). The most reasonablel field for this property is “description”. Availible fields: short:the word or term wich is to replace and to link shortcut:alternative notation of the word / term for using in backend longversion: the short description of the term for the title attribute description:long description of the term, it is only displayed in the glossary exclude:check box for excluding this entry on the glossary page link:link to further information source | |
[type] | -->stdWrap | For each type of explanation (html element, e.g. acronym or abbr) the short word can be processed via stdWrap funktion before it is embedded in the explanatory markup. The lang and title attributes are loaded to the TSFE->register, so you can retrieve them via stdWrap data functions. For example, the tag “abbr” is not supported by Internet Explorer. [browser = msie] config.tx_a21glossary { abbr.dataWrap = <span class="abbr"{register:title}>|</span> } [global] This will produce the following markup, if the browser is IE: <abbr title=”etcetera”> <span class=”abbr” title=”etcetera”>etc.</span> </abbr> In other browsers the output will be only <abbr title=”etcetera”>etc.</abbr> | |
typolink | -->typolink | Configuration of the link to the glossary entry. The complete link generation is based on this configuration, the extension adds nothing to it. Actually your own list plugin for displaying the glossary records can be used, so the current link configuration is only an example: typolink { # normally the link goes to the glossary page parameter = {$a21glossary.glossaryPage}# alternatively it can go to another page defined in the glossary entry, e.g. to Wikipedia parameter.override.field = link additionalParams.field = uid # the links points to the current entry uid additionalParams.wrap = &tx_a21glossary[uid]=| # the current page number will be also submitted additionalParams.dataWrap = |&tx_a21glossary[back]={TSFE:id}# cHash is important for cached pages useCacheHash = 1 ATagParams = class="glossary" } Be careful, your typolink configuration must be accordant to the glossary list configuration, see below. | |
noLang | boolean | If set, the lang attribute is not added to the replacing markup. default: <abbr lang=”de”>usw.</abbr> If noLang=1: <abbr>usw.</abbr> | 0 |
xmlLang | boolean | If set, the xml:lang attribute is added to the markup: <abbr lang=”de” xml:lang=”de”>usw.</abbr> It is needed for xhtml compliance. | 0 |
[tsref: config.tx_a21glossary]
Example
A possible configuration of the replacing engine (taken from static template of this extension):
config.tx_a21glossary {caseSensitiv = 1
excludePages = {$a21glossary.glossaryPage} excludePages.{$a21glossary.glossaryPage} = acronym,abbr,dfn pidList = {$a21glossary.storagePage}linkToGlossary = acronym,abbr,dfn
linkOnlyIfNotEmpty = description
typolink { parameter = {$a21glossary.glossaryPage}parameter.override.field = link
additionalParams.field = uid
additionalParams.wrap = &tx_a21glossary[uid]=|
additionalParams.dataWrap = |&tx_a21glossary[back]={TSFE:id}useCacheHash = 1
ATagParams = class="glossary"
}
}
Frontend glossary configurations
The frontend plugin is based exclusively on already well known TypoScript Content Objects “COA” and “CONTENT”. The top level object tx_a21glossary_main corresponds to the homonymous database table and defines the displaying of each record. The plugin configuration for the glossary list is made in tt_content.list.20.a21glossary. Check the static extension template EXT:a21glossary/static/ in the Template Analyser. The glossary records can be also displayed with another custom plugin.
Extending with new types / HTML elements
This is very easy, just change the backend form entries via TSConfig, e.g.:
TCEFORM.tx_a21glossary_main.shorttype {addItems.q = Quotation
addItems.ins = Insertion
addItems.del = Deletion
}