Templates download/Language switcher and Templates download: Difference between pages

(Difference between pages)
No edit summary
Tag: 2017 source edit
 
No edit summary
Tag: 2017 source edit
 
Line 1: Line 1:
<div class="downloadarea">
=Templates=
<span class="getButton">[[Media:HW-LanguageSwitcher.zip|Download]]</span>
{{Messagebox|boxtype=note|icon=|Note text=These templates use extensions which are included in BlueSpice pro, but not in BlueSpice. These extensions are noted for each template:
* [[Reference:Page_Forms|Page Forms (PF)]]
* [[Reference:Semantic_MediaWiki|Semantic MediaWiki (SMW)]]
* [[Reference:TemplateData|TemplateData (TD)]]|bgcolor=}}


[[File:HW-languageswitcher.png|350x350px|alt=language switcher screenshot]]
<div class="cards">
</div>This download file includes two versions of a language switcher. Supported languages can be defined in the templates.
__NOTOC__
<!--start card------------------>
<div>
==Action points==
<div class="box">
<div class="screenshot">[[File:HW-AP.png|600x600px|alt=Action points template|link=Templates download/Action points]]</div>
<div class="text">[[Templates download/Action points|Action points for meetings]] (SMW, TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==Button link==
<div class="box">
<div class="screenshot">[[File:HW-ButtonLink.png|300x300px|alt=Button link template|link=Templates download/ButtonLink]]</div>
<div class="text">[[Templates download/ButtonLink|Link styled as button]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==Calendar==
<div class="box">
<div class="screenshot">[[File:calendar.png|500x500px|alt=Calendar template|link=Templates download/Calendar]]</div>
<div class="text">[[Templates download/Calendar|Simple event calendar]] (SMW, PF)</div>
</div>
</div>
<!--start card------------------>
<div>
==Icons==
<div class="box">
<div class="screenshot">[[File:Icon-template.png|400x400px|alt=Screenshot of icons on a page|link=Templates download/Icon]]</div>
<div class="text">[[Templates download/Icon|Insert Bootstrap icons]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==IMS Documents==
<div class="box">
<div class="screenshot">[[File:HW-IMS.png|400x400px|alt=Process descriptions overview page|link=Templates download/IMS Documents]]</div>
<div class="text">[[Templates download/IMS Documents|Document control templates]] (SMW, PF)</div>
</div>
</div>
<!--start card------------------>
<div>
==Incidents & Risks==
<div class="box">
<div class="screenshot">[[File:RM-riskentry.png|500x500px|alt=Risk entry screenshot|link=Templates download/Risk management]]</div>
<div class="text">[[Templates download/Risk management|Risk registry and incident reports]] (SMW, PF)</div>
</div>
</div>
<!--start card------------------>
<div>
==Language switcher==
<div class="box">
<div class="screenshot">[[File:HW-languageswitcher.png|300x300px|alt=Language switcher screenshot|link=Templates download/Language switcher]]</div>
<div class="text">[[Templates download/Language switcher|For use in single wikis (TD)]]</div>
</div>
</div>
<!--start card------------------>
<div>
==Mention==
<div class="box">
<div class="screenshot">[[File:HW-mention-output.png|300x300px|alt=Mention template|link=Templates download/Mention]]</div>
<div class="text">[[Templates download/Mention|User mention with notification]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==Message box==
<div class="box">
<div class="screenshot">[[File:HW-messagebox-en.png|450x450px|alt=Message box template|link=Templates download/Messagebox]]</div>
<div class="text">[[Templates download/Messagebox|Color-coded box (optional icons)]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==Minutes==
<div class="box">
<div class="screenshot">[[File:HW-Minutes-en.png|460x460px|alt=Main meeting minutes template|link=Templates download/Minutes for teams]]</div>
<div class="text">[[Templates download/Minutes for teams|Teams-based main template]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==Portal==
<div class="box">
<div class="screenshot">[[File:HW-PortalFlex-Combo.png|400x400px|alt=Portal page template|link=Templates download/PortalFlex]]</div>
<div class="text">[[Templates download/PortalFlex|Forms-based portal page]] (PF)</div>
</div>
</div>
<!--start card------------------>
<div>
==SVG==
<div class="box">
<div class="screenshot">[[File:svg-animated.gif|300x300px|link=Templates download/SVG]]</div>
<div class="text">[[Templates download/SVG|Embedded interactive SVG]] (TD, Widgets)</div>
</div>
</div>
<!--start card------------------>
<div>
==Subpages list==
<div class="box">
<div class="screenshot">[[File:HW-subpages.png|alt=Subpages template|link=Templates download/Subpages|400x400px]]</div>
<div class="text">[[Templates download/Subpages|List of subpages for a page]]</div>
</div>
</div>
<!--start card------------------>
<div>
==TOC Limit==
<div class="box">
<div class="screenshot">[[File:template-download-TOClimit.png|alt=TOC limit template|link=Templates download/TOClimit|460x460px]]</div>
<div class="text">[[Templates download/TOClimit|Limit heading levels in TOC]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div>
==Transclusion==
<div class="box">
<div class="screenshot">[[File:HW-transclusion.png|alt=Transcluded page section|link=Templates download/Transclusion|460x460px]]</div>
<div class="text">[[Templates download/Transclusion|Transclude a page section]] (TD)</div>
</div>
</div>
<!--start card------------------>
<div class="emptycard"></div>
<!--start card------------------>
<div class="emptycard"></div>
</div>


==Importing the template==
=Page templates=
The import file is included in the archive file ''HW-LanguageSwitcher.zip''. Unpack the zip file first.
<br />
 
<br />
On the page ''Special:Import'' follow these steps:
<div class="cards">
 
<!--start card------------------>
#'''Select file''' and choose ''HW-LanguageSwitcher.xml''.
<div>
#'''Enter''' an Interwiki prefix. Since this field is required, simply add ''hw'' (for hallowelt).
==Minutes: Customer projects==
#'''Keep''' the selection ''Import to default locations''.
<div class="box">
#'''Click''' ''Upload file...'' .
<div class="screenshot">[[File:HW-Minutes-customer projects.png|600x600px|alt=Template for customer project meeting minutes|link=Templates download/Minutes customer projects]]</div>
 
<div class="text">[[Templates download/Minutes customer projects|Customer projects meeting minutes]]</div>
The templates are now available in your wiki.
</div>
==Pages included in the import==
</div>
The xml import creates the following files in your wiki:
<!--start card------------------>
 
<div>
* Template:Languages
==Minutes: Management==
* Template:InterLanguages
<div class="box">
* Template:Languages/styles.css
<div class="screenshot">[[File:HW-Minutes-management.png|800x800px|alt=Template for management meeting minutes|link=Templates download/Minutes JF management]]</div>
 
<div class="text">[[Templates download/Minutes JF management|Management meeting minutes]]</div>
== How it works ==
</div>
 
</div>
=== Template:Languages ===
This template is used to switch between a page and its translated versions when the translations are maintained as subpages.
 
The template defines some variables to determine which languages you want to support. It automatically determines the content language of your wiki installation. '''This variable "cl" is required and must not be deleted.'''
* You need to define at least one language for the switcher to make sense. Each language variable is named as lowercase l (for language)  "l1", "l2",.... The value needs to be provided as the [https://de.wikipedia.org/wiki/Liste_der_ISO-639-1-Codes ISO 639-1 language code] for the language. For Spanish, you would define:<syntaxhighlight lang="text">
{{#vardefine:l4|es}}
</syntaxhighlight>
* After defining the variables, you need to add them to the actual switcher:<syntaxhighlight lang="text">
{{#switch: {{SUBPAGENAME}}
|{{#var:l1}}={{#var:switcher}}
|{{#var:l2}}={{#var:switcher}}
|{{#var:l3}}={{#var:switcher}}
|{{#var:l4}}={{#var:switcher}}
|{{#var:clswitcher}}}}
</syntaxhighlight>
*A tracking property enssures that the different languages are available for further processing through Semantic MediaWiki. This allows to create page lists of the different languages.:<syntaxhighlight lang="text">
<!-- set tracking property //-->
[[Languages/tracklang::{{#switch: {{SUBPAGENAME}}|{{#var:l1}}={{#var:l1}}|{{#var:l2}}={{#var:l2}}|{{#var:l3}}={{#var:l3}}|{{#var:l4}}={{#var:l4}}|{{#var:cl}}}}]]
</syntaxhighlight>
 
*Alternatively, especially in BluesSpice free (where no SMW functions and therefore no attributes are available by default), tracking categories can be used. These are commented out in the template by default. The comment must therefore be removed and all languages tracked as a category:<syntaxhighlight lang="text">
{{#switch: {{SUBPAGENAME}}|{{#var:l1}}=[[Category:{{#var:l1}}]]|{{#var:l2}}=[[Category:{{#var:l2}}]]|{{#var:l3}}=[[Category:{{#var:l3}}]]|{{#var:l4}}=[[Category:{{#var:l4}}]]|[[Category:{{#var:cl}}]]}}
</syntaxhighlight>
* In addition, you should add the language to the template description for the extension [[Reference:TemplateData|TemplateData]]:<syntaxhighlight lang="text">
"description": {
        "en": "Language switcher",
"de": "Sprachwechsler",
"fr": "Sélecteur de langue",
"nl": "Taal verandering",
"es": "Cambiador de idioma"
}
</syntaxhighlight>
 
=== Template:InterLanguages ===
This template is used to switch between a page and its translated versions when the translations are not maintained as subpages, but are technically not associated at all.
 
The template defines some variables to determine which languages you want to support.  '''The variable "self" defines the current page. It is required and must not be deleted.'''
 
The language variables are defined just like in the template Languages. If you define additional language variables, the newly defined languages has to be added to the language menu. The links are created in the following container:<syntaxhighlight lang="text">
<div id="langbar-hz">
...
</div>
</div>
</syntaxhighlight>Simply add each language with the l-number matching your language variable by copying this line and replacing the number:<syntaxhighlight lang="text">
<headertabs />
{{#if: {{{pgnamel4|}}}|{{#switch:{{{pgnamel4|}}}|{{#var:self}}=[[{{FULLPAGENAME}}{{!}}{{#var:l4}}]]|[[{{{pgnamel4}}}{{!}}{{#var:l4}}]]}}|}}
</syntaxhighlight>In addition, you need to add the language to the template description and the available fields in the TemplateData editor.
 
In source editing mode:
 
# '''Click''' ''Manage TemplateData''[[File:interlanguages-manageTD.png|alt=Manage TemplateData|center|thumb|650x650px|Manage TemplateData]]<br />
# '''Click''' ''Add parameter''[[File:interlanguages-manageTD-addparam.png|alt=Add new languages (as parameters)|center|thumb|514x514px|Add new languages (as parameters)]]
# '''Select''' any new language you have added and click '''Apply'''.[[File:interlanguages-manageTD-editparam.png|alt=Selecting a newly added paramter|center|thumb|515x515px|Selecting a newly added paramter]]
# '''Add''' the language abbreviation for the new language as a label and activate the ''Suggested'' checkbox and click '''Done.'''[[File:interlanguages-manageTD-paraminfo.png|alt=Parameter settings|center|thumb|521x521px|Parameter settings]]
# '''Click''' ''Add language'' to add a new template description for this language.[[File:interlanguages-manageTD-addlang.png|alt=adding a template description|center|thumb|450x450px|adding a template description]]
# '''Select''' the user language that corresponds to the current language parameter.[[File:interlanguages-manageTD-addlang-es.png|alt=select user language|center|thumb|450x450px|select user language]]<br />
# '''Enter''' a template description and click '''Apply'''. This description is shown when the user selects a template in the visual editor.[[File:interlanguages-manageTD-addlang-es-desc.png|alt=template description|center|thumb|450x450px|template description]]
{{Messagebox|boxtype=important|icon=|Note text=If you have changed the original default values for the language variables, make sure to change the language labels here accordingly. The labels for the l1, l2, l3,... languages need to match.<br/>[[File:interlanguages-manageTD-labels.png|alt=check correct language associations|center|thumb|300x300px|check correct language associations]]}}
 
==Displaying the switcher on a page==
For the language switcher to work, you need to create the  language versions of a page as subpages of the actual content language, e.g. in an English wiki:
 
*Vacation policy
*Vacation policy/de
*Vacation policy/fr
 
The template is then added to each language version:
#Add the template ''Languages'' from the  [[Manual:Extension/VisualEditor|VisualEditor]] insert-dialog.
#Provide a display title if the page is a subpage. For example for the Vacation policy/de, enter "Urlaubsregelung":[[File:HW-languageswitcher-templatedata.png|alt=Setting a display title|center|thumb|400x400px|Setting a display title]]


==Alignment of the language switcher==
[[en:{{FULLPAGENAME}}]]
By default, the language switcher appears on the right side of the page. To display it on the left side, change the following line in the page Template:Languages/styles.css:<syntaxhighlight lang="css">
[[de:Vorlagen Download]]
#langbar-hz {text-align: left;}
</syntaxhighlight>__NOTOC__

Revision as of 16:23, 6 April 2022

Note:These templates use extensions which are included in BlueSpice pro, but not in BlueSpice. These extensions are noted for each template:


Action points

Button link

Calendar

IMS Documents

Incidents & Risks

Language switcher

SVG

svg-animated.gif

Transclusion



Minutes: Customer projects

Minutes: Management



To submit feedback about this documentation, visit our community forum.

No categories assignedEdit

Discussions