Help:Collegamenti

From mediawiki.org
This page is a translated version of the page Help:Links and the translation is 66% complete.
Outdated translations are marked like this.
PD Nota: Quando modifichi questa pagina, acconsenti a pubblicare il tuo contributo con licenza CC0. Vedi le pagine di aiuto sul dominio pubblico per maggiori informazioni. PD

Esistono cinque tipi di collegamenti ipertesto in MediaWiki:

  1. Collegamenti interni ad altre pagine dello stesso wiki (comunemente chiamati "wikilinks")
  2. Collegamenti esterni a pagine di altri siti web
  3. Collegamenti esterni a pagine interne nello stesso wiki
  4. Collegamenti Interwiki ad altri siti web che utilizzano prefissi speciali registrati in anticipo
  5. Collegamenti interlinguistici ad altri wiki registrati come versioni linguistiche diverse del wiki corrente

Si noti che questo elenco non include la categoria dei collegamenti e i collegamenti di file, che vengono utilizzati per posizionare le pagine in categorie e visualizzare immagini o altri file multimediali, rispettivamente.

Collegamenti interni

Per creare un cosiddetto collegamento interno a una pagina sullo stesso wiki (un "wikilink"), utilizzare le doppie parentesi quadre del marcatore wiki, [[come questo]]. Quando si visualizza l'anteprima o si salvano le modifiche, viene visualizzato un collegamento che può essere seguito per raggiungere la pagina di destinazione. Se la pagina esiste il collegamento è visualizzato in blu (come la parola "creare" nella prima frase del paragrafo); se la pagina non esiste il collegamento appare rosso (quindi il collegamento [[come questo]] è reso così like this). Si noti che i colori potrebbero essere differenti se lo schema colori del wiki è stato cambiato rispetto all'impostazione predefinita. Note that the colors could be different if the color scheme of the wiki has been changed from the default. Seguendo tale "collegamento_rosso" a una pagina mancante (che sia effettivamente rossa o meno), di solito l'utente può creare la pagina.

Per contrassegnare qualsiasi stringa di testo arbitraria (non necessariamente un titolo di pagina) come descrizione del collegamento, utilizzare il carattere "barra verticale" o "pipe", come ad esempio: [[Help:Categories|Collegamento alla categoria]]

La prima lettera del collegamento non è sensibile alle maiuscole e minuscole (a meno che il wiki non sia configurato diversamente), il che significa che i collegamenti possono essere maiuscoli o meno (quindi How to contribute e how to contribute sono equivalenti). Tuttavia, ogni lettera successiva deve corrispondere esattamente alla pagina di destinazione (quindi How to contribute and How To Contribute non sono equivalenti). Gli spazi nel titolo della pagina possono essere rappresentati come trattini bassi (quindi How to contribute e How_to_contribute sono di nuovo equivalenti), ma l'uso dei trattini bassi nei collegamenti li renderà visibili nel testo della pagina (ma questo può essere evitato usando un "pipe").

Se il titolo della pagina a cui ci si collega è quello della pagina che si sta modificando, il risultato non è affatto un collegamento ipertestuale, ma semplicemente un testo in grassetto (per esempio, in questa pagina il markup [[Help:Links/it]] dà come risultato Help:Links/it). Se si sta cercando di creare un collegamento wiki alla pagina corrente, probabilmente si vuole collegare a una specifica sezione o a un'ancora all'interno della pagina; si vedano gli esempi seguenti.

MediaWiki utilizza la tabella pagelinks per mantenere i riferimenti ai collegamenti wiki interni.

Nome/Descrizione Sintassi Risultato
Collegamento interno
[[Main Page]]

[[Help:Contents]]

[[Extension:DynamicPageList (Wikimedia)]]

Main Page

Help:Contents

Extension:DynamicPageList (Wikimedia)

Collegamenti che utilizzano il pipe per la descrizione
[[Help:Editing pages|editing help]]

Collegamento ad una sezione/ancora con la pagina di destinazione.

[[Help:Editing pages#Preview|previewing]]

Collegamento con il pipe ad un'ancora sulla stessa pagina

[[#See also|different text]]

Vedere anche meta:Help:Piped link.

editing help

previewing

different text

Pipe trick
[[Manual:Extensions|]]

[[User:John Doe|]]

[[Extension:DynamicPageList (Wikimedia)|]]

[[Extension:DynamicPageList (third-party)|]]

La trasformazione operata dal trucco del pipe senza testo a seguire può dare come risultato la stessa descrizione per diversi collegamenti, come si vede negli esempi di DynamicPageList.

Extensions

John Doe

DynamicPageList

DynamicPageList

Collegamenti con fine-parola
[[Help]]s

[[Help]]ing

[[Help]]ers

[[Help]]almostanylettersyoulikehere

[[Help]]BUTnotalways

Che fanno parte delle "regole del percorso del collegamento" presenti nelle traduzioni di ogni lingua.

Helps

Helping

Helpers

Helpalmostanylettersyoulikehere

HelpBUTnotalways

Evitare i
"Collegamenti con fine-parola"
[[Help]]<nowiki />ful advice

[[wikipedia:GNU General Public License|GPL]]<nowiki />v3

Helpful advice

GPLv3

Link a un'ancora nella stessa pagina
[[#See also]]

Le Ancore vengono definite automaticamente per le intestazioni di sezione e per l'inzio ([[#top]]) della pagina.

#See also
Impostare un'ancora per il collegamento in entrata
<div id="Unique anchor name 1">optional text</div>

<span id="Unique anchor name 2">optional text</span>

Utilizzati rispettivamente per la modalità livello-blocco e in-linea. Con queste definizione posso usare il collegamento [[#Unique anchor name 1]] all'interno della stessa pagina o [[Help:Links/it#Unique anchor name 1]] da una pagina differente. Potete omettere "optional text" per definire un Ancora invisibile.

Si può definire un'Ancora anche in una intestazione di sezione:

==<span id="Alternate Section Title"></span>Section heading==

È importante lche sia nella posizione inziale. Questa deve essere una etichetta "span" e non un'etichetta "div". (Queste Ancore permettono di puntare ad una sezione con un nome alternativo senza interrompere i collegamenti in entrata).

testo opzionale

testo opzionale

Section heading
Collegamento a un'ancora in un'altra pagina
[[Help:Images#Supported media types for images]]
Help:Images#Supported media types for images
Collegamento alla pagina "discussioni" della pagina Wiki corrente.
[[{{TALKPAGENAME}}|Discussion]]

Vedi anche Aiuto:Parole magiche#Nomi di pagina

Discussion
Collegamento a una sottopagina
[[/example]]

Scorciatoia per [[Help:Links/example|/example]]. Vedere anche Aiuto:Sottopagine .

/example
Collegamento ad una sottopagina senza la barra iniziale
[[/example/]]

Scorciatoia per [[Help:Links/example|example]].

example
Collegamento ad un'altra sottopagina della pagina principale di quella corrente. Può essere utilizzato solo nelle sottopagine.
[[../example2]]

Scorciatoia per [[Help:Links/example2|example2]] se inserite il collegamento nella pagina [[Help:Links/example|example]].

example2
Collegamento visibile ad una pagina di categoria
[[:Category:Help]]

Senza i due-punti iniziali il collegamento non è visibile e in più la pagina verrà posta nella categoria definita; questo è un errore comune. Vedere anche Help:Categorie .

Category:Help
Collegamenti visibili ad un'immagine o ad un file media

File:Example.jpg

file label

Media:Example.jpg

file label

Collegamento ad una specifica pagina dell'utente (pagina personale, ecc.)
[[Special:MyPage]]

[[Special:MyTalk]]

[[Special:Preferences]]

Special:MyPage

Special:MyTalk

Special:Preferences

Collegamento interno a una versione specifica
[[Special:PermanentLink/2393992]]

Il numero di revisione lo si può trovare nella pagina della Cronologia presente in ogni pagina Wiki. (Può capitare di vedere collegamenti a specifiche revisioni implementate come collegamenti esterni perché è facile copiare-incollare per errore l'intero URL della revisione all'interno della definizione del collegamento esterno)

Special:PermanentLink/2393992
Collegamento interno a una pagina con le "diff"erenze di 2 revisioni
[[Special:Diff/2393992]]

[[Special:Diff/2390639/2393992]]

Se si indica un solo numero di revisione (primo esempio) viene visualizzata la differenza con la revisione precedente. Anche qui sono validi i commenti presenti nella voce precedente.

Special:Diff/2393992

Special:Diff/2390639/2393992

Reindirizzamento
#REDIRECT [[Main Page]]

Deve essere la prima ed unica linea nella pagina. Vedere Help:Redirect .

 Main Page

Collegamenti esterni

Per definire un collegamento esterno, solitamente ad una pagina di un sito esterno, racchiudi tra singole parentesi quadre l'URL, seguito da uno spazio e dalla descrizione del collegamento (vedi gli esempi seguenti). Quando salvi la pagina o la visualizzi in anteprima vedrai che il collegamento appare leggermente differente rispetto a quello interno: può avere un colore differente e sarà seguito da un'icona con una freccia proprio ad indicare che punta ad un altro sito.

Descrizione Digiti Ottieni
Collegamento esterno con uno specifico testo descrittivo
[https://mediawiki.org MediaWiki]
MediaWiki
Collegamento esterno numerato
[https://mediawiki.org]

Questo capita se ometti il testo descrittivo. Più collegamenti esterni di questo tipo nella stessa pagina vengono numerati sequenzialmente. Multiple links of this type on the same page are numbered sequentially.

[1]
Collegamento esterno implicito
https://mediawiki.org

Gli URL che iniziano con "http://" e "https://" sono automaticamente considerati come collegamenti esterni anche se non sono racchiusi da parentesi quadre.

https://mediawiki.org
Evitare l'auto-riconoscimento di URL esterni
<nowiki>https://mediawiki.org</nowiki>
https://mediawiki.org
Collegamento esterno protocollo-dipendente
[//en.wikipedia.org Wikipedia]

[//en.wikipedia.org //en.wikipedia.org]

Il collegamento sarà in HTTP o HTTPS a seconda del protocollo della pagina corrente (che può essere differente per gli utenti). Questa funzione è disponibile solo se il collegamento è definito all'interno delle parentesi quadre[ ]. Inserendo solamente "//en.wikipedia.org" non viene riconosciuto alcun collegamento.

Wikipedia

//en.wikipedia.org

Collegamento esterno al server corrente
https://{{SERVERNAME}}/pagename
https://www.mediawiki.org/pagename
Collegamento esterno ad un altro server passando il nome della pagina corrente
https://google.com/search?q={{PAGENAMEE}}

Vedi anche: Nomi di pagina in codifica URL, Manual:PAGENAMEE encoding

https://google.com/search?q=Links
Collegamento apertura composizione email
[mailto:info@example.org email me]
email me
Apertura composizione email con soggetto, corpo e testo descrittivo
[mailto:info@example.org?Subject=URL%20Encoded%20Subject&body=Body%20Text info]
info
URI personalizzato
[skype:echo123 call me]

Ogni URI che vuoi utilizzare deve prima essere definito attraverso l'istruzione $wgUrlProtocols . (Questo esempio non è abilitato qui su MediaWiki.org)

[skype:echo123 call me]

Using email links

Email links use mailto: before the address. They're written like this: [mailto:anyone@example.org address name] (resulting in address name). If there's no name, the address is automatically numbered, like this: [mailto:anyone@example.org] becomes [2]. Addresses without square brackets won't be linked, e.g., anyone@example.com. You can also add a CC using [mailto:anyone@example.org?cc=anyone2@example.org address name] (resulting in address name). To add a subject, use [mailto:me@me.com?subject=Me] "

Collegamenti esterni a pagine interne

Per aggiungere un collegamento ad un pagina dello stesso Wiki ma dovendo definire anche i parametri URL, devi utilizzare la sintassi dei collegamenti esterni.

Descrizione Digiti Ottieni
Collegamento esterno alla pagina di modifica della pagina corrente
[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]

[{{fullurl:{{FULLPAGENAME}}|action=edit}} Edit this page]

Vedi anche Help:Magic_words#URL_data e Collegamenti esterni sopra esposto.

Edit this page

Edit this page

Collegamento esterno alla pagina di modifica della pagina corrente ma con uno stile come un collegamento interno
<span class="plainlinks">[https://www.mediawiki.org/w/index.php?title=Help:Links&action=edit Edit this page]</span>

La classe "plainlinks" può essere utilizzata nel caso si voglia far apparire un collegamento esterno come uno interno ovvero non visualizzando l'icona che normalmente viene postposta.

Edit this page

The arrow icon

Some skins add an arrow icon after each external link by default. However, this can be avoided by using class="plainlinks". For instance:

  • [http://a a] gives a
  • <span class="plainlinks">[http://a a]</span> gives a

Using Linksearch

Special:Linksearch is a built-in tool that helps find pages linked to a specific URL. By using the externallinks table, it generates a comprehensive list of page names where the link originates, along with the complete target link for each source page. You can search in all namespaces or just one. It supports wildcard (*) use, so you can search by top-level domain (e.g. [3]), second-level domain (e.g. [4]), etc. or refine your search by specifying parts of the URL e.g. [5].

Notes:

  • Avoid including "http://".
  • The program might not return any results if there is a colon in the URL.
  • MediaWiki page names in URLs should have underscores instead of spaces. The Linksearch function also requires underscores in URLs.
  • Linksearch is sensitive to capitalization, multiple underscores, and the use of "index.php". It may not find alternative URLs even if they lead to the same target. Therefore, when creating an external link, it's best to use the canonical form of the URL. If the address bar displays a modified URL after following a link, update the URL in the link accordingly for optimal use of Linksearch.
  • The list is sorted by URL, using standard page name order. Note that an underscore, unlike a blank space, is alphabetically positioned between "Z" and "a".

Using backlinks

Normally, internal links within a project are easy to spot and useful for finding related pages. But when there's a mix of internal and external links, it can be tricky to track backlinks, it necessitates the use of both "Help:What links here" and "Linksearch". However, for links to specific sections or anchors, it's possible to include both an internal link and, with CSS styling using "display=none" an external link to provide backlink.

External links are better than interwiki links. With Linksearch, you can even find backlinks to specific sections or anchors. So, combining both internal and external links while hiding the external ones "<span style="display:none">http://...</span>", gives us the best of both worlds.

Limitazioni

  1. I collegamenti esterni non supportano la funzione fine-parola.
  2. I collegamenti esterni non vengono conteggiati nella pagina Special:WhatLinksHere (Chi punta qui).

Collegamenti Interwiki

I collegamenti Interwiki sono collegamenti in stile collegamento-interno che puntano ad altri siti Web (che possono non essere Wiki, nonostante il nome). Ad esempio, potete definire un collegamento all'articolo https://en.wikipedia.org/wiki/Sunflower semplicemente digitando [[wikipedia:Sunflower]] o, per questo wiki, anche il più corto [[w:Sunflower]]. Per entrambe le definizioni si otterrà un collegamento a wikipedia:Sunflower. Tutto questo funziona perché per definizione MediaWiki configura wikipedia: come un "prefisso interwiki" che converte automaticamente in https://en.wikipedia.org/wiki/ quando utilizzato all'interno di [[ ]] (può non funzionare su l'amministratore del sito ha cambiato la configurazione). Diversamente dai collegamenti interni quelli Interwiki non individuano l'esitenza della pagina di destinazione, ovvero il collegamento apparirà sempre di colore blu anche se la pagina di destinazione non esiste.

Come per i collegamenti interni, potete creare dei collegamenti con il carattere "|" o "pipe" che permette di definire un testo alternativo al collegamento; ad esempio [[wikipedia:Sunflower|grande fiore giallo]] è il collegamento a " grande fiore giallo" e [[wikipedia:Sunflower|]] è il collegamento Sunflower.

Essenzialmente un collegamento Interwiki è un collegamento abbreviato ad collegamento esterno utilizzato di frequente. Il collegamento di esempio sarebbe definito, per esteso, come [https://en.wikipedia.org/wiki/Sunflower grande fiore giallo].

Altre informazioni più dettagliate si trovano su Manual:Interwiki e m:Help:Interwiki linking. Il tuo wiki può avere una pagina Special:Interwiki con elencati i prefissi Interwiki configurati; questa è l'elenco predefinito dei prefissi Interwiki. Puoi sempre modificare la tabella dei prefissi $1 del tuo sito. Your wiki may have a Special:Interwiki page listing the interwiki prefixes it supports; here is the default interwiki list. You can edit the interwiki table on your site.

Collegamenti interlingua

Se il tuo Wiki ha altre versioni in lingue diverse, puoi trovare i collegamenti interlingua nella barra laterale, appena sotto gli strumenti, in una sezione chiamata “in altre lingue.”

Nelle marcature wiki un collegamento interlingua è molto simile ad un link interno ma il comportamento è più simile ad un collegamento di categoria anche se viene visualizzato in una modalità diversa. Mentre i collegamenti di categoria vengo visualizzati in uno speciale elenco posto alla fine della pagina (di solito), i collegamenti interlingua appaiono in un elenco speciale nella barra laterale di una pagina (o altrove, a seconda della configurazione dello skin usato).

Lo scopo del collegamento interlingua è collegare pagine con lo stesso argomento ma in una lingua differente. Per creare un collegamento interlingua digitate [[prefisso_lingua:nome pagina]] ovunque nella pagina (preferibilmente a fine pagina, come per i collegamenti di categoria); il "prefisso_lingua" è il prefisso specificato nel vostro wiki per la versione dell'altra lingua (solitamente un codice lingua definito in ISO 639-1). Un collegamento interlingua è unidirezionale, non permette di creare in automatico sulla pagina dell'altra lingua un collegamento che punti a questa pagina con questa lingua. A tale scopo deve essere creato manualmente nella pagina dell'altra lingua un collegamento interlingua che punti a questa pagina con la relativa lingua. Non funziona come il "Modifica collegamento" nella sezione delle lingue in una versione di Wikipedia-multilingua. Ma può essere utilizzato con gli "spazi nomi", come 'User:' per puntare al profilo di un utente in altre lingue.

Se volete che il collegamento interlingua appaia in uno specifico posto della vostra pagina invece della barra laterale, anteponete un due-punti prima del prefisso_lingua:

[[:en:Sunflower]]en:Sunflower

Quando un collegamento è sia Interwiki che interlingua deve essere definito con il seguente ordine dei prefissi wikipedia:en:Sunflower.

Per ulteriori informazioni, vedi m:Help:Interwiki linking#Collegamenti interlingua.


Piped links

A piped link is an internal link or interwiki link where the 'target page name' of the link and its 'label' are both specified.

This is useful in cases where the user wants to values of 'target page name' and 'label' to be different. This also enables linking a contextually relevant word or phrase within the text of a page rather than using the generic value "see also". The wording does not need to match the name of the target page. Depending on the preferences set for the current user and a supported browser, you can still see the link target: when you hover your cursor over the link, the name shows up in a pop-up window and is also shown in the status bar.

For example:

[[coffeehouse setup|Get Piping Hot Coffee Here!]]

will show: Get Piping Hot Coffee Here!

Let's take another example: [[help:Piped link|piped link]] will be displayed as piped link. This can be done when context makes it clear that the page being linked to is in the help namespace. The piped link is a better way of doing this, rather than mistakenly linking to piped link which might be a disambiguation page or not exist.

Fun Fact: The term piped refers to the use of the pipe character "|", which in this context is used to separate the more descriptive description from the actual name of the linked page.

The Pipe character was named after an alternative use of it; see Pipe (computing).

Using a redirect as an alternative

An alternative way is to use redirect pages.

To create Get Piping Hot Coffee Here!, use [[Get Piping Hot Coffee Here!]] and make it redirect to coffeehouse setup (please note: unlike above, what pops up when you point at the link, depending on your browser's support, is the text that is already shown).

It is convenient if the redirect is already there or will also be of use elsewhere. However, there are a few drawbacks.

  • the popup does not show the destination page
  • "Related changes" shows the changes in the redirect page not the redirect target
  • the redirect message that is shown on the target page slightly clutters it

Using a piped link and a redirect together, it is possible to provide information in the hover box that is not the name of the linked page, for example, the value of a unit in terms of other units. In that case, it is possible to make a page whose page name is the information that you'd like in the link title, and which redirects to the page with a more appropriate name.

For example, the page w:30.48 cm redirects to w:Foot (unit).

Pipe trick

If the part after the "|" in a piped link is left empty, it is converted to an abbreviated form of the page name on the left, based on the following rules:

  1. Any word that is before the first colon (:), as well as the colon character itself, is removed.This word may or may not be a 'namespace' prefix (such as "Help:") or an 'interwiki' prefix (such as "commons:").If the name of the page is preceded by a colon (:), "first" refers to "first after this".
  2. If there is some text in the parentheses at the end, then it will be removed.
  3. If there are no parentheses, but there is a comma (,) character, the comma and everything after it is removed.
  4. Note that this does not work for sections/anchors as [[Help:Piped_link#Pipe_trick|]] outputs [[Help:Piped_link#Pipe_trick|]].

Similar to using the three or four tildes when signing on Talk pages, and using 'subst', in a preview, the result shows up in the preview itself, but the conversion in the edit box is not shown yet. Click on the "Show changes" option to see the change in the wikitext.

Examples
  • [[Help:Template|]] is converted to [[Help:Template|Template]], which is shown as Template
  • [[Music: My life|]] is converted to [[Music: My life| My life]], which is shown as My life - although "Music:" itself is not a namespace (therefore the space after the colon character is not automatically removed), however, the shortcut works anyway
  • [[w:en:Pipe (computing)|]] is converted to [[w:en:Pipe (computing)|en:Pipe]], which is shown as en:Pipe.
  • [[commons:Boston, Massachusetts|]] is converted to [[commons:Boston, Massachusetts|Boston]], which is shown as Boston.
  • [[w:{{{1}}}|]] does not give [[w:{{{1}}}|{{{1}}}]], and calling the template with a value of parameter 1 gives a working link, but in the case of substitution only.
  • [[w:en:{{FULLPAGENAME}}|]] does not give [[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]] and [[m:{{FULLPAGENAME}}|]] does not give [[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]]
  • [[Wikipedia:Village pump (technical)#Pipe trick|]] is not converted, so it does not give a working link.
This wikitext Produces
* [[project:a (b)|]]
* [[w:project:a (b)|]]
* [[:de:project:a (b)|]]
* [[wiktionary:project:a (b)|]]
* [[wiktionary:de:project:a (b)|]]
* [[wikibooks:project:a (b)|]]
* [[wikiquote:project:a (b)|]]
* [[wikisource:project:a (b)|]]
* [[wikisource:project:a (b)#c|]]
* [[w:en:{{FULLPAGENAME}}|]] [[w:en:{{FULLPAGENAME}}|en:{{FULLPAGENAME}}]]
* [[m:{{FULLPAGENAME}}|]] [[m:{{FULLPAGENAME}}|{{FULLPAGENAME}}]]
* a
* project:a
* project:a
* project:a
* de:project:a
* project:a
* project:a
* project:a
* [[wikisource:project:a (b)#c|]]
* [[w:en:Help:Links/it|]] en:Help:Links/it
* [[m:Help:Links/it|]] Help:Links/it
Category tag

Since the sortkey syntax of the category is similar to a piped link, the pipe trick also works for category tags, even though technically, it is not useful there.

Limitation

  • [[Help:L{{tc}}k|]] using template:tc is not converted, so the result is rendered as [[Help:Link|]] which is not as a working link.This is because like substitution, the pipe trick expansion occurs before ordinary expansion of the templates, etc.The pipe trick does not work if the linked page includes invalid characters.Therefore, while ordinarily the acceptability of the target page name is assessed after template expansion, the pipe trick expansion judges it before that.The braces are therefore considered invalid characters in the page name.Instead, a template can be used like template:pipe trick: {{pipe trick|Help:|L{{tc}}k}} which renders as Link.

Inverse pipe trick

On page "A (c)", [[|b]] is converted to [[b (c)|b]] automatically.

Similarly, on page "A, c", [[|b]] is converted to [[b, c|b]] automatically.

Anchors

Linking to an anchor

Links in the format [[#anchor_name]] will direct to the first matching anchor on the page, typically corresponding to the first identical section heading.

You can add an [[#anchor_name]] to a link, directing it to the first matching section heading (or anchor) on the named page:

[[Help:Editing#Advanced editing]]

https://www.mediawiki.org/wiki/Help:Editing#Advanced_editing

Using an automatic anchor

Section headings serve as anchors, using the heading text as the anchor name. If there are multiple sections with identical headings, each subsequent occurrence is appended with "_2", "_3", etc.

The anchor #toc links to the page's table of contents, except when there's a section titled "toc."

A manual anchor

Manually-set anchors are beneficial for linking to "unlinkable" elements such as tables (titles or cells) or sections of plain text. For instance, in the External links to internal pages section above, although the column text "Description" resembles a (minor) heading, it is not.

There are several methods to set an anchor at any position:

  • The "anchor" template, if it exists on your wiki, specified as {{Anchor }}, offers a standardized method to create anchor points. Place the template where you want, using the syntax {{Anchor|Name_of_Anchor}}. For instance, {{Anchor|Description}} is placed in the "Description" column of the table below the "External links to internal pages" section. Clicking on #Description links to that anchor point created on the table. The anchor is only visible via the source code.
  • Use the generic anchor tag <span id="anchor_name">some text</span> with optional text for visible anchors. For hidden anchors, omit the text. To point to the anchor use [[#anchor_name]].
  • Avoid using manual HTML headings like <h2>Editing Instructions</h2>. This text serves as an anchor_name.
  • In certain instances, adding an ID attribute similar to HTML within a Wiki-element is necessary. Take, for instance, the table mentioned earlier, titled External links to internal pages:
border="1" class="wikitable" id="You type"
  • A top of a page can be accessed using the reserved term [[#top]].

See also Help:Section#Linking sections using an arbitrary id.

Using Linksearch anchors

As mentioned above, if external link style is used, e.g. [6], we can use Special:Linksearch: [7].

When using Linksearch, it's helpful to add leading zeros to numerical anchor names to prevent unintended matches. For example, instead of searching for "1", use "01" to avoid including "10". This practice is seen in w:Portal:Current events/DateHeader2. Similarly, if there are anchors like "a" and "ab", using "_a" can distinguish them in search results.

Anchorencode

The #anchorencode parser function encodes input to use as an anchor. For example, to external link to #Using linksearch anchors above, you would use https://www.mediawiki.org/wiki/Help:Links#{{anchorencode:Using Linksearch anchors}}, which resolves to https://www.mediawiki.org/wiki/Help:Links#Using_Linksearch_anchors

Subpage feature

MediaWiki has a subpage feature that may or may not be active depending on the project and namespace. If it's activated, the following rules apply; otherwise, "A/b" is simply a standalone page with that name.

A page's tree structure is formed using forward slashes in page names: A/b is considered a subpage of A, making A the parent of A/b; additionally, A/b/c is a subpage of A/b; meanwhile, A/a, A/b, and A/c are categorized as sibling pages.

The subpage body automatically displays links to all parent pages without needing specific wikitext. These links appear even if the parent page doesn't exist. However, if any ancestor page in the sequence is missing, the chain of links will stop before that point. Additionally, the capitalization of letters after the forward slash in the page name matters, meaning "/subpage" and "/Subpage" refer to different pages.

The functions, What links here and [Help:Related changes|]] do not consider these automatically generated links."

When the subpage feature is enabled within a namespace, any forward slash in a page's name automatically creates a subpage structure, regardless of whether it was intended or not.

You can find a list of subpages using Special:PrefixIndex.

Using variables

When utilizing the subpage feature within namespace A on page A:B/c/d, {{BASEPAGENAME}} shows B/c while {{SUBPAGENAME}} shows d.

Using relative links

Within a subpage hierarchy, you can utilize the following relative links:

  • [[../]] links to the parent page of the current subpage. For example, on page A/b, it takes you to page A, and on page A/b/c, it directs you to page A/b.
  • [[../../]] links to the grandparent page of the current subpage. For example, on page A/b/c, it points to page A.
  • [[../s]] links to a sibling page of the current subpage. For example, on page A/b, it leads to page A/s.
  • [[../../s]] links to an "uncle" page of the current subpage. For example, on page A/b/c, it points to page A/s.
  • [[/s]] links direct to a subpage. On page A, it functions similarly to [[A/s]]. However, linking from a namespace with an enabled subpage feature to a main namespace page starting with "/" requires a workaround: adding a colon before the page name.

Relative links remain functional even when all pages within a hierarchy are renamed to reflect a change in the root's name, even if the root becomes a child of a new parent. Users with the appropriate permissions, such as administrators and those with the move-subpages right, have the option to move both the main page and its subpages during a renaming process.

Learn more about subpages at w:Wikipedia:Subpages. See examples at Help:Link/example and Help:Link/example/example2

Subpage activation

This feature is only enabled in namespaces specified in the $wgNamespacesWithSubpages configuration setting, either its default namespaces, or any additional namespaces set in LocalSettings.php

Character conversion

The guidelines outlined in m:Help:Page name state that in wiki and interwiki links, conversions are made to non-literal characters automatically. For example,"[[Help:Page%20name]]" will display as "m:Help:Page name". Conversely, external links operate oppositely; literal characters are transformed into non-literal characters. For example, browsers typically convert ".../wiki/!" to ".../wiki/%21".

Applying a code like %70 to a redirect deactivates it, even though the link remains accessible from the redirect page. To ensure a successful redirect, the redirect page displays the canonical form of the target, unlike the preview page which shows the link in its regular format.

Miscellaneous

Some additional effects of links

  • Related changes
  • Backlinks, Linksearch
  • When you include a space after the pipe symbol ([[main Page| ]]), the outcome can vary depending on the browser. In some cases, it might only display a space (" "), without creating a clickable link. However, it's still recognized as a link by the "what links here" feature.

"Hover box" on links

In certain web browsers, when you place the cursor over a link, a tooltip may appear, displaying the content of the link's HTML title attribute. MediaWiki assigns different values to this attribute depending on the type of link: for internal wikilinks, it displays the page name and (page does not exist), if the page does not exist; for interwiki links, it displays the page name with a prefix; and for external links, it displays the URL.

The browser might also display similar information in its status bar, possibly showing which section it belongs to.

Using a piped link , even if it isn't clicked, can help clarify acronyms (like displaying "neutral point of view" as NPOV) or adding annotations. Hover boxes can also be created without links, you can customize the hover box content using markup like [[Link title|<span title="hoverbox">Display text</span>]].

You cannot include a title attribute directly within the href element for external links. Nevertheless, you can achieve a similar outcome by using a span element instead, like this: [http://www.example.com <span title="hover text on external link">www.example.com web site</span>] :
www.example.com web site

Retrieving links from a page

The MediaWiki API allows users to retrieve all links from a page. For example, you can utilize the API query called API:Links to achieve this.

Linking to a page from an image

You can utilize images to direct users to other pages. For further details, refer to the guidance on utilizing an image to link to a specific page in the help section.

Limiti

Un collegamento interno è limitato dalla massima dimensione del page title.

Vedi anche