Manual:Footer

This page is a translated version of the page Manual:Footer and the translation is 36% complete.

フッターにリンクを追加する

MediaWiki バージョン:
1.35

You can do it in LocalSettings.php . See the examples for:

Internal links
$wgHooks['SkinAddFooterLinks'][] = function ( Skin $skin, string $key, array &$footerlinks ) {
    if ( $key === 'places' ) {
        $footerlinks['test'] = Html::rawElement( 'a', [
			'href' => Title::newFromText(
				$skin->msg( 'test-page' )->inContentLanguage()->text()
			)->getFullURL()
		], $skin->msg( 'test-desc' )->escaped() );
    };
};
外部リンク
$wgHooks['SkinAddFooterLinks'][] = function ( Skin $skin, string $key, array &$footerlinks ) {
    if ( $key === 'places' ) {
        $footerlinks['test'] = Html::rawElement( 'a',
            [
                'href' => 'https://www.example.org/wiki/Project:Imprint',
                'rel' => 'noreferrer noopener' // not required, but recommended for security reasons
            ],
        $skin->msg( 'test-desc' )->escaped() // test-desc is an i18n message of the text
        );
    };
};

In the above examples, test-page and test-desc are the keys for the system messages added via the code. Do not forget to add the desired text to the pages MediaWiki:Test-page and MediaWiki:Test-desc, respectively, after you added the code for the extra footer links to the LocalSettings.php file.

In JavaScript

Menus can be extended using

mw.util.addPortletLink('footer-links', 'link', 'link' )

Note for MediaWiki versions before 1.44.0

Prior to the 1.44.0 release, the mobile site by default hides any additional links via CSS. You can workaround this by adding the following rule to MediaWiki:Minerva.css.

ul.footer-places li {
  display:inline !important;
}
MediaWiki バージョン:
1.35

You can also add custom text through LocalSettings.php . Here is an example to add wikitext to the footer:

$wgHooks['SkinAddFooterLinks'][] = function ( Skin $skin, string $key, array &$footerlinks ) {
    if ( $key === 'info' ) {
        $footerlinks['tagline'] = $skin->msg( 'footer-tagline' )->parse();
    }
};

This adds footer-tagline as a key for the system message to be displayed in the footer. After adding the code to LocalSettings.php, please edit the MediaWiki:Footer-tagline page to edit the newly-added footer text.

組み込み項目のカスタマイズ

また、特定のページやパラメータを変更することで、個々の組み込み項目をカスタマイズすることも可能です。

lastmod
edit MediaWiki:Lastmodifiedat. If $wgMaxCredits is enabled then edit MediaWiki:Lastmodifiedatby. You may also want to edit MediaWiki:othercontribs that shows other contributors. (6518)
credits
  • if $wgMaxCredits is not zero it will display page editors
  • つまり、$wgMaxCredits = 10;やその他の数値を設定する。
copyright
edit MediaWiki:Copyright. The parameter $1 on that page is replaced with a link to the details of copyright for your wiki. In LocalSettings.php $wgRightsText for the link text and set either $wgRightsPage or $wgRightsUrl with the location of a wiki page or external URL.
privacy
this is a link only. Edit MediaWiki:Privacy for the link text and MediaWiki:Privacypage for the wiki page to which to link.
about
this is a link only. Edit MediaWiki:Aboutsite for the link text and MediaWiki:Aboutpage for the wiki page to which to link.
disclaimer
this is a link only. Edit MediaWiki:Disclaimers for the link text and MediaWiki:Disclaimerpage for the wiki page to which to link.
tagline
フッターに使用されていない If you would like to add text to the footer, see #Add text to the footer.

プライバシー、Wikiについて、免責事項のリンクを完全に削除するには、リンクテキストをダッシュ1つ(「-」)に置き換えてください。

画像

$wgFooterIcons を参照してください。

関連項目