Manual:Interwiki/pt
Hiperligações interwiki são hiperligações para as páginas de outros projetos, utilizando um prefixo de estilo de hiperligação interna.
As hiperligações Interwiki tornam possível interligar as páginas da Wikipédia, Wikilivros, Wikinotícias, etc..., ou para o seu próprio projeto wiki em diferentes idiomas. (Consulte Manual:Família de Wikis .)
Uma hiperligação como [[Wikipedia:Main Page]]
irá aparecer como isto: Wikipedia:Main Page e redireciona-o para a 'Página Principal' da Wikipédia.
Hiperligações interwiki para outros projetos
Tabela e API de consulta
As hiperligações interwiki estão alojadas na tabela interwiki da base de dados do MediaWiki.
Pode recuperar a lista de interwiki da propriedade interwikimap
da API de consulta do meta siteinfo , em outras palavras, fazendo um pedido de API, como:
Predefinição
Vários projetos do Wikimédia (e outras) estão preparadas por predefinição para a interligação de interwiki, e assim, pode utilizá-las sem editar a sua base de dados.
A seguir, tem alguns exemplos de prefixos de interwiki disponíveis (também disponível na Wikipédia, versão 1.10 e superior):
prefixo | URL de destino | exemplo de utilização |
---|---|---|
commons | https://commons.wikimedia.org/wiki/ | [[commons:MediaWiki]] |
mediazilla | http://bugzilla.wikimedia.org/ | [[mediazilla:1209]] |
metawikimedia (antes da versão 1.23: metawikipedia) | https://meta.wikimedia.org/wiki/ | [[metawikimedia:Main Page]] |
A lista completa de prefixos predefinidos da interwiki está disponível em maintenance/interwiki.list
Consulte a interligação de interwiki nas wikis da Wikimédia para informação completa sobre como interligar de/para projetos da Wikimédia.
Adicionar um novo site da Web para interligação de interwiki
- As hiperligações interwiki são definidas na tabela da base de dados
interwiki
. - Estas podem ser modificadas em Special:Interwiki pelos utilizadores que têm o direito de
interwiki
. You might need to add the line$wgGroupPermissions['sysop']['interwiki'] = true;
to your wiki's configuration for this to work. No MediaWiki 1.44 e superior, esta funcionalidade está integrada no núcleo do MediaWiki. As versões antigas podem utilizar a extensão Interwiki .
Para testar
Para testar a configuração:
- Vá para o seu site,
- crie um artigo, com o seguinte conteúdo:
[[w:Wikipedia:Village pump|]]
- Isto deveria exibir uma hiperligação para a página da 'Esplanada' em en.Wikipedia.org (o url
https://en.wikipedia.org/wiki/Wikipedia:Village_pump
)
Documentação de campo
Dica para administradores: Várias páginas da ajuda interligam para o espaço nominal "Manual" de MediaWiki.org. Para que estas hiperligações funcionem na sua wiki local, adicione a hiperligação interwiki com
iw_prefix=manual
e iw_url=http://www.mediawiki.org/wiki/Manual:$1
Dica para administradores: $wgTranscludeCacheExpiry no seu
LocalSettings.php
deveria ser definido se forem efetuadas alterações na wiki transcrita. Alternativamente, pode limpar a tabela transcache na sua wiki local.
Hiperligações de interwiki para outros idiomas

If you have installed a Wiki family , you can link from an article in English to an article in German (if you have a German project, too). You can set up MediaWiki to show those links in the sidebar, just below the toolbox.
In your filesystem, there is a subfolder of your MediaWiki installation, called "languages".
Go there and have a look at Names.php
as it contains a list of known languages and their prefixes.
E.g. you want to add your German project, search Names.php
for "Deutsch" and note the prefix "de".
If you know the "right" prefix, edit your database by adding a new line to table interwiki
:
iw_prefix | o prefixo de idioma (por exemplo, "de" para alemão), que é listado em Names.php |
iw_url | URL para o seu projeto wiki (por exemplo, http://de.example.org/index.php/$1 ) |
iw_local |
same as above at #Adding a new website for interwiki linking |
iw_trans |
same as above at Adding a new website for interwiki linking |
Agora, pode interligar um artigo ao mesmo em outros idiomas.
Adicionando [[de:Hauptseite]]
na página principal em inglês (Main_Page), irá criar o link "Deutsch" abaixo da caixa de ferramentas, que leva à página principal do wiki alemão
Note, that this link is shown in Sidebar's section, only, and not inside of the article.
If you want to create a link inside of the text, you have to add a colon previous to the prefix: [[:de:Hauptseite]]
or set $wgInterwikiMagic to false.
Exportar a tabela da interwiki de outra wiki
The following JavaScript code performs the API query to retrieve the interwiki map of an existing wiki, then displays the SQL INSERT statements to fill the interwiki table on a new wiki. You run it for example by injecting the code through your browser's developer tools, or by placing it inside Special:MyPage/skinname.js and previewing.
function ExtractInterwikiMapTable() {
$.getJSON(mw.config.get('wgScriptPath') + '/api.php?action=query&meta=siteinfo&siprop=interwikimap&format=json', function(data) {
var iw_prefix, iw_url, iw_local, iw_api, re_escape = /(')/g, result = '';
for (var i = 0, iwm = data.query.interwikimap; i < iwm.length; i++) {
iw_prefix = "'" + iwm[i].prefix.replace(re_escape, '\\$1') + "'";
iw_url = "'" + iwm[i].url.replace(re_escape, '\\$1') + "'";
iw_local = (typeof iwm[i].local == 'string') ? '1' : '0';
iw_api = "'" + (iwm[i].iw_api || '').replace(re_escape, '\\$1') + "'";
result += 'INSERT INTO interwiki (iw_prefix, iw_url, iw_local, iw_trans, iw_api) VALUES ('+iw_prefix+', '+iw_url+', '+iw_local+', 0, '+iw_api+');\n'
}
$('<textarea style="width:800px;height:400px;"/>').val(result).appendTo(document.body);
});
}
$(ExtractInterwikiMapTable);
Hiperligações interwiki vs. hiperligações externas
[[imdbtitle:0389790|Bee Movie]]
→Bee Movie
[http://www.imdb.com/title/tt0389790 Bee Movie]
→Bee Movie
Linksearch works for the latter only.
Wikitext using interwiki links isn't always easily transferable between different wikis because they don't consistently use the same interwiki prefixes, or they might not have them at all. Additionally, interwiki links can sometimes mislead users since they don't know when they're being sent to another site.
You can choose between "extiw" and "external text" CSS classes for links, depending on whether you want them to look the same or different. Using just the interwiki link is easier to type, but copying the URL from the webpage is handy. Templates like w:Template:imdb title can be set up to use either an interwiki link with a parameter like "tt0389790" or "0389790", or an external link with a parameter like one of those or the full URL, making it easier to include IMDb references.
As an alternative to interwiki linking, a template can be created to wrap a plaintext page title into a URL-encoded external link to a known wiki, which can then be called with syntax equivalent to interwiki links. This preserves the appearance of external links while providing the same convenience as interwiki linking.
<!-- Template:IW --> [https://example.com/wiki/{{urlencode:{{{1}}}|WIKI}} {{{2|{{{1}}}}}}]
Then, instead of [[iw:External Page Title]]
, call the template:
{{IW|External Page Title}}
→ External Page Title{{IW|External Page Title|Alternate text}}
→ Alternate text
Hiperligações interwiki para a wiki local
Interwiki links can be configured to point to the same wiki they are being rendered from. Por exemplo, mw:Manual:Interwiki/pt direciona para esta página. These links are treated identically to internal links and do show up on Special:WhatLinksHere, appear bold if they are a selflink like the above, appear red if the page doesn't exist, etc.
Consultar também
- Ajuda: Hiperligações
- Extensão:Interwiki (fornece Special:Interwiki)
- Manual:$wgExtraInterlanguageLinkPrefixes
- Manual:Tabela de Interwiki
- Mapa Interwiki de MediaWiki.org