Manual:Footer
フッターにリンクを追加する
MediaWiki バージョン: | ≧ 1.35 |
In MediaWiki 1.35, links can be added or overridden via the SkinAddFooterLinks hook. (See Manual:Footer/legacy for older installs.) For example, in an extension:
// Add a link to the page "Test Page" with the text "Test", allowing modification by wiki administrators
// test-desc and test-page are i18n messages with the text of the link and the name of the page, respectively
public static function onSkinAddFooterLinks( Skin $skin, string $key, array &$footerlinks ) {
if ( $key === 'places' ) {
$footerlinks['test'] = $skin->footerLink( 'test-desc', 'test-page' );
}
}
または、サイト管理者でLocalSettings.php で行いたい場合:
$wgHooks['SkinAddFooterLinks'][] = function ( Skin $skin, string $key, array &$footerlinks ) {
if ( $key === 'places' ) {
$footerlinks['test'] = $skin->footerLink( 'test-desc', 'test-page' );
};
};
外部リンクにも対応しています:
// Add a link to this page (https://www.mediawiki.org/wiki/?curid=6031)
// test-desc is an i18n message of the text
$footerlinks['test'] = Html::element( 'a',
[
'href' => 'https://www.mediawiki.org/wiki/?curid=6031',
'rel' => 'noreferrer noopener' // not required, but recommended for security reasons
],
$skin->msg( 'test-desc' )->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
- フッターに使用されていない
プライバシー、会社概要、免責事項のリンクを完全に削除するには、リンクテキストをダッシュ1つ(「-
」)に置き換えてください。
画像
- $wgFooterIcons を参照してください。
テキストと画像
2016年9月現在、テキストと画像を同時に構成するエントリーを追加する標準的な方法はないようです。