Mal:Sikker lenke

Fra Wikipedia, den frie encyklopedi
(Omdirigert fra «Mal:Sec link»)

Portal:Forside

Maldokumentasjon

This is the {{Sikker lenke}} template.

It creates a secure link. The link can be local or to any other Wikimedia project. It can for instance link to Wiktionary or the Portuguese Wikipedia.

Secure links go through the Wikimedia secure server, so they give you an encrypted connection between your browser and the Wikimedia servers.

Note! For most usage cases you should instead use {{Sikker lenke auto}}. That one creates a secure link only if the user is already using the secure server, otherwise it makes a normal link. For other secure link templates see the see also section below.

Usage[rediger kilde]

{{Sikker lenke| project | Pagename | text | lang = de }}

This templates takes one or more parameters:

  • The first is the prefix of the Wikimedia project you want to link to. For instance "wiktionary" or "wikt" for Wiktionary, and "de" for the German Wikipedia. This parameter must always be fed. For the complete list of prefixes see Wikipedia:InterWikimedia links, Special:SiteMatrix and meta:List of Wikipedias.
  • The second parameter is the full pagename you want to link to, such as "User:Example" or "São Paulo". If this parameter is omitted then this template links to the main page of the project.
  • The third parameter is the text that will be visible as the link. If this parameter is omitted the link address is instead shown.
  • There is also a named parameter "lang=". This parameter is usually not used. It takes a language prefix such as "de" or "pt". This enables to link to for instance the German version of Wiktionary. If this parameter is omitted, then this template links to the same language on the other project as you are on here. So if on the English Wikipedia, and you link to Wiktionary, per default you get a link to the English Wiktionary.

Here's some examples:

{{Sikker lenke| commons }}

{{Sikker lenke| wikt }}

{{Sikker lenke| de }}

{{Sikker lenke| pt }}

commons:

wikt:

de:

pt:

{{Sikker lenke| commons | São Paulo }}

{{Sikker lenke| wikt | São Paulo }}

{{Sikker lenke| de | São Paulo }}

{{Sikker lenke| pt | São Paulo }}

commons:São Paulo

wikt:São Paulo

de:São Paulo

pt:São Paulo


{{Sikker lenke| pt | São Paulo | São Paulo, in the Portuguese Wikipedia. }}

São Paulo, in the Portuguese Wikipedia.


{{Sikker lenke| wikt | São Paulo | lang=pt }}

{{Sikker lenke| lang=pt | wikt | São Paulo | São Paulo, in the Portuguese Wiktionary. }}

wikt:pt:São Paulo

São Paulo, in the Portuguese Wiktionary.

In the above example we fed "lang=pt" before the other parameters. That is okay since named parameters don't interfere with the numbering of unnamed parameters.

This template can of course also create a secure link to the same project as it currently is used on. For instance, even if already on the English Wikipedia this works:

{{Sikker lenke| en | | Secure link to the main page of the English Wikipedia }}

Secure link to the main page of the English Wikipedia

Anchors and queries[rediger kilde]

This template can also handle anchors and query parameters. Like this:

{{Sikker lenke| en | Template:Sikker lenke | anchor = See also }}

{{Sikker lenke| en | Special:Search | query = search=secure+server&fulltext=Search&ns4=1&ns5=1 }}

{{Sikker lenke| de | Wikipedia:Spielwiese | query = action=edit | Edit the German Wikipedia's sandbox }}

en:Template:Sikker lenke#See also

en:Special:Search?search=secure+server&fulltext=Search&ns4=1&ns5=1

Edit the German Wikipedia's sandbox

When feeding query parameters you must manually change any spaces " " to plus signs "+". But feed anchors unchanged.

The padlock[rediger kilde]

The small padlock is automatically added to all https links by the global CSS in all Wikimedia projects. This template does not suppress that, since it makes it clearer it is a secure link. But if you want to suppress the padlock, then there are two ways. Like this:

{{Sikker lenke| padlock=no | pt | São Paulo }}

<span class="plainlinks">
{{Sikker lenke| pt | São Paulo }}
</span>

pt:São Paulo

pt:São Paulo

Using "padlock=no" is easier for a single link. But when having many links then surrounding the whole area with "<span class="plainlinks"></span>" can be more convenient.

Many templates such as the mboxes, navboxes and infoboxes use the "plainlinks" class since it also prevents the external link icon . Thus when this template is used inside such boxes it looses the padlock. Then you can turn on the padlock like this:

{{Sikker lenke| padlock=yes | pt | São Paulo }}

pt:São Paulo

Technical details[rediger kilde]

When you are connected to the secure server, then most local links in a project is automatically secure links. But hardcoded links and links to other projects are unfortunately not auto-changed to secure links. With this template you can work around that.

This template doesn't handle the "bugzilla:" prefix, since it already points to a secure server.

Some languages on Wikisource don't have their own language project, instead they are pages under the main "oldwikisource:" address. For instance the Afrikaans main page on Wikisourse is not "{{Sikker lenke|wikisource|lang=af}}", but instead "{{Sikker lenke|oldwikisource|Tuisblad}}".

This template internally uses the sub-templates {{Sikker lenke/secure url}}, {{Sikker lenke/text}} and {{case preserving encode}}. It also has the sub-templates {{Sikker lenke/normal url}} and {{Sikker lenke/normal link}}, but they are used by its sister templates such as {{Sikker lenke auto}} and {{Sikker lenke image}}.

For more technical details see the talk page.