Template:InterProject/doc
| This is a documentation subpage for Template:InterProject. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used to generate links to sister projects similar to Interlanguage links. The template creates a box with the listed links above the display of interwiki links in the sidebar. It is not intended for use in the article namespace.
Usage
{{InterProject
|meta=
|metaglobal=
|commons=
|b=
|n=
|q=
|s=
|v=
|d=
|wikt=
|voy=
|species=
|incubator=
|mw=
}}
Parameters
For every parameter the page name must be entered separately. It should be noted that the localized name of the target wiki or the international name is used for the namespace (for example, user for the user-namespaces). A leading colon is not required.
For every sister project you can exactly specify one link. In sister projects with different languages (like Wikibooks), however, you can link to languages other than English: with {{Interprojekt|b=de:User:Example}} you link to the German-language Wikibooks.
Programming
JavaScript must be enabled to use this template. To apply this template to a different wiki, the following javascript code is needed (see also MediaWiki:Common.js for the current code; see also wikt:de:MediaWiki:InterProject.js):
/*
## ProjektLinks ##
by Skript von [[user:Merlissimo]] (Idee basierend auf http://de.wiktionary.org/wiki/MediaWiki:Common.js von [[User:Pathoschild]] und [[wikt:de:User:Melancholie]])
erzeugt Sitebar-Interwiki zu Schwesterprojekten aufgrund von Vorlage [[Vorlage:InterProjekt]]
siehe auch Feature-Request [[bugzilla:708]]
*/
if( mw.config.get( 'wgNamespaceNumber' ) > 0 ) {
mw.loader.using( [ 'mediawiki.util' ], function() { $( function() {
var iProject = $( '#interProject' );
if( !iProject.length ) {
return;
}
var sistersibling = $( '#p-lang' );
if( !sistersibling.length ) {
sistersibling = $( '#p-tb' );
}
if( !sistersibling.length ) {
return;
}
//Link auf Parennode des Portletmenues
var sisterparent = sistersibling.parent();
//Erzeuge neues Portletmenue
var sisterprojectnav = $( document.createElement( 'div' ) );
sisterprojectnav.attr( 'id', 'p-sisterprojects' );
sisterprojectnav.attr( 'class', sistersibling.attr( 'class' ) );
var header = $( document.createElement( 'h3' ) );
header.text( $( '#sisterProjects:first' ).text() );
sisterprojectnav.append( header );
var portletDiv = $( document.createElement( 'div' ) );
var sistersiblingsub = sistersibling.find( 'div:first' );
if( sistersiblingsub.length ) {
portletDiv.attr( 'class', sistersiblingsub.attr( 'class' ) );
} else {
portletDiv.attr( 'class', 'pBody' );
}
sisterprojectnav.append( portletDiv );
//Wenn möglich vor den Interwikis einfügen
if ( sisterparent.has( '#p-lang' ).length ) {
sisterprojectnav.insertBefore( '#p-lang' );
} else {
sisterparent.append( sisterprojectnav );
}
//Schwesterlinks ermitteln und einfügen
iProject.find( 'a' ).each( function() {
$this = $( this );
var sistername = $this.text();
mw.util.addPortletLink(
'p-sisterprojects',
$this.attr( 'href' ) + '?uselang=' + mw.util.rawurlencode( mw.config.get( 'wgUserLanguage' ) ),
sistername,
'sister-' + sistername,
sistername
);
});
})});
}
/** End of code for Template:Interproject */
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.