Шаблон:Sec link auto/doc

Материал из Dharmakaya

Перейти к: навигация, поиск

This is the {{sec link auto}} template.

It creates a secure link only if the user is using the secure server, otherwise it makes a normal 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.

This template is mostly meant for links to other projects, since local links that use the normal wikilink notation "[[Page]]" are already automatically changed to secure links when using the secure server. But hardcoded local links such as "[http://en.wikipedia.org/wiki/Example?action=history Example history]" are not auto-changed. Then you can use this template to fix that.

If you want to make a link that sends all users to the secure server, then instead use {{sec link}}. For other secure link templates see the see also section below.

Содержание

Usage

{{sec link auto| project | Pagename | text | lang = de }}

This templates takes one or more parameters:

To compare how the links on this page look and behave when using the secure server, follow this link: {{sec link auto}}

And here's some examples:

{{sec link auto| commons }}

{{sec link auto| wikt }}

{{sec link auto| de }}

{{sec link auto| pt }}

commons:

wikt:

de:

pt:


{{sec link auto| commons | São Paulo }}

{{sec link auto| wikt | São Paulo }}

{{sec link auto| de | São Paulo }}

{{sec link auto| pt | São Paulo }}

commons:São Paulo

wikt:São Paulo

de:São Paulo

pt:São Paulo


{{sec link auto| pt | São Paulo | São Paulo, in the Portuguese Wikipedia. }}

São Paulo, in the Portuguese Wikipedia.


{{sec link auto| wikt | São Paulo | lang=pt }}

{{sec link auto| 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.

Anchors and queries

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

{{sec link auto| en | Template:Sec link auto | anchor = See also }}

{{sec link auto| en | Special:Search | query = search=secure+server&fulltext=Search&ns4=1&ns5=1 }}

{{sec link auto| de | Wikipedia:Spielwiese | query = action=edit | Edit the German Wikipedia's sandbox }}

en:Template:Sec link auto#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

When these links are seen from the secure server, then they all have a small padlock16x13px. That 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 when it is a secure link.

But if you want to suppress the padlock, then there are two ways. Like this:

{{sec link auto| padlock=no | pt | São Paulo }}

<span class="plainlinks">
{{sec link auto| 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 10x10px. Thus when this template is used inside such boxes it looses the padlock. Then you can turn on the padlock like this:

{{sec link auto| padlock=yes | pt | São Paulo }}

pt:São Paulo

Note: You will only see a padlock in the above example if you view this page from the secure server, since this template only makes secure links if you already are using the secure server.

Technical details

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 "{{sec link auto|wikisource|lang=af}}", but instead "{{sec link auto|oldwikisource|Tuisblad}}".

This template internally uses the sub-templates {{sec link/secure url}}, {{sec link/normal url}}, {{sec link/normal link}} and {{sec link/text}}. Those sub-templates are also used by its sister templates.

For more technical details see the talk page.

See also


Личные инструменты
Пространства имён
Варианты
Действия
Навигация
Инструменты