Templates download/Language switcher: Difference between revisions

(Created page with "<nowiki><div class="downloadarea"></nowiki> <nowiki><span class="getButton">Download</nowiki><nowiki></span></nowiki> <nowiki>File:HW...")
 
No edit summary
Tag: 2017 source edit
Line 1: Line 1:
<nowiki><div class="downloadarea"></nowiki>
<div class="downloadarea">
<span class="getButton">[[Media:HW-LanguageSwitcher-en.zip|Download]]</span>


<nowiki><span class="getButton">[[Media:HW-LanguageSwitcher-de.zip|Download]]</nowiki><nowiki></span></nowiki>
[[File:HW-languageswitcher.png|350x350px|alt=language switcher screenshot]]
</div>This template creates a  language switcher that supports English, German and French language pages. It can be inserted into a  wiki page via the VisualEditor ''Insert > Template'' menu.
==Importing the template==
(The download file here only works in a wiki that is set to the content language English. For downloading the file for a wiki with content language set to German, go to the German Helpdesk.)




<nowiki>[[File:HW-languageswitcher.png|350x350px]]</nowiki>
The import file is included in the archive file ''HW-LanguageSwitcher-en.zip''. Unpack the zip file first.


<nowiki></div></nowiki>This template creates a link that is styled as a button. It can be inserted into a  wiki page via the VisualEditor <nowiki>''</nowiki>Insert > Template<nowiki>''</nowiki> menu.
On the page ''Special:Import'' follow these steps:


<nowiki>==Importing the template==</nowiki>
#'''Select file''' and choose ''HW-LanguageSwitcher-en.xml''.
 
#'''Enter''' an Interwiki prefix. Since this field is required, simply add ''hw'' (for hallowelt).
The import file is included in the archive file <nowiki>''</nowiki>HW-ButtonLink.zip<nowiki>''</nowiki>. Unpack the zip file first.
#'''Keep''' the selection ''Import to default locations''.
 
#'''Click''' ''Upload file...'' .
 
On the page <nowiki>''</nowiki>Special:Import<nowiki>''</nowiki> follow these steps:
 
 
<nowiki>#</nowiki><nowiki>'''</nowiki>Select file<nowiki>'''</nowiki> and choose <nowiki>''</nowiki>HW-ButtonLink.xml<nowiki>''</nowiki>.
 
<nowiki>#</nowiki><nowiki>'''</nowiki>Enter<nowiki>'''</nowiki> an Interwiki prefix. Since this field is required, simply add <nowiki>''</nowiki>hw<nowiki>''</nowiki> (for hallowelt).
 
<nowiki>#</nowiki><nowiki>'''</nowiki>Keep<nowiki>'''</nowiki> the selection <nowiki>''</nowiki>Import to default locations<nowiki>''</nowiki>.
 
<nowiki>#</nowiki><nowiki>'''</nowiki>Click<nowiki>'''</nowiki> <nowiki>''</nowiki>Upload file...<nowiki>''</nowiki> .
 
 
The template is now available in your wiki.<nowiki>{{Messagebox|boxtype=important|Note text=The input fields for the template parameters are usually not automatically available after importing the template to your wiki . You have to open the imported template file and make an edit (e.g., add a space and then save the page) to activate the template data functionality. The input fields should now be displayed correctly when you use the template on a page.}}</nowiki>
 
<nowiki>==Pages included in the import==</nowiki>


The template is now available in your wiki.
==Pages included in the import==
The xml import creates the following files in your wiki:
The xml import creates the following files in your wiki:


* Template:Languages
* Template:Languages/styles.css


<nowiki>*</nowiki>Template:ButtonLink
==Using the template==
 
For the language switcher to work, you need to create the language versions of a page as the English pages subpages, e.g.:
 
<nowiki>==Using the template==</nowiki>
 
 
<nowiki>#</nowiki>Add the template from the  <nowiki>[[Manual:Extension/VisualEditor|VisualEditor]]</nowiki> insert-dialog.
 
<nowiki>#</nowiki>Fill in the form fields as needed.
 
 
<nowiki>[[File:HW-ButtonLink-templatedata.png|center|thumb|450x450px|Insert-dialog for button link|link=Special:FilePath/HW-ButtonLink-templatedata.png]]</nowiki>
 
 
<nowiki>===Settings===</nowiki>
 
<nowiki>{| class="contenttable-blue" style="width:100%;"</nowiki>
 
! style="width:200px;" |Input field
 
!Description
 
|-
 
| style="width:200px;" |Is this an external link?
 
|yes = the link target starts with http:// or https://
 
Leave blank for internal wiki page
 
|-
 
| style="width:200px;" |Link target
 
|Name of the wiki page or the website
 
|-
 
| style="width:200px;" |Label
 
|Label shown on the button
 
|-
 
| style="width:200px;" |Background color
 
|Possible button colors: red, blue (leave blank for white)
 
|}
 
 


<nowiki><br /></nowiki>
* Vacation policy
* Vacation policy/de
* Vacation policy/fr


The template is 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]]


<nowiki>__NOTOC__</nowiki>
__NOTOC__

Revision as of 17:14, 10 February 2022

This template creates a language switcher that supports English, German and French language pages. It can be inserted into a wiki page via the VisualEditor Insert > Template menu.

Importing the template

(The download file here only works in a wiki that is set to the content language English. For downloading the file for a wiki with content language set to German, go to the German Helpdesk.)


The import file is included in the archive file HW-LanguageSwitcher-en.zip. Unpack the zip file first.

On the page Special:Import follow these steps:

  1. Select file and choose HW-LanguageSwitcher-en.xml.
  2. Enter an Interwiki prefix. Since this field is required, simply add hw (for hallowelt).
  3. Keep the selection Import to default locations.
  4. Click Upload file... .

The template is now available in your wiki.

Pages included in the import

The xml import creates the following files in your wiki:

  • Template:Languages
  • Template:Languages/styles.css

Using the template

For the language switcher to work, you need to create the language versions of a page as the English pages subpages, e.g.:

  • Vacation policy
  • Vacation policy/de
  • Vacation policy/fr

The template is added to each language version.

  1. Add the template Languages from the VisualEditor insert-dialog.
  2. Provide a display title if the page is a subpage. For example for the Vacation policy/de, enter "Urlaubsregelung":
    Setting a display title
    Setting a display title




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