Podręcznik:Stopka
Dodanie linków do stopki
Wersja 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() );
};
};
- External links
$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;
}
Add text to the footer
Wersja 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.
Dostosowywanie wbudowanych wpisów
Możesz też dostosować już wbudowane linki poprzez modyfikację odpowiednich stron lub parametrów:
lastmod
- (ostatnio zmodyfikowano) – edytuj MediaWiki:Lastmodified. Jeżeli $wgMaxCredits jest włączony to zmień MediaWiki:Lastmodifiedatby. Możesz też zmienić MediaWiki:othercontribs pokazujący innych autorów zmian. (6518)
credits
-
- (autorzy) - jeżeli ustawienie $wgMaxCredits nie będzie zerem to wyświetli użytkowników, którzy edytowali stronę
- np. ustaw
$wgMaxCredits = 10;
lub inną liczbę
copyright
- (prawa autorskie) - zmień w $mw-copyright. Parametr $1 jest zamieniany na link do strony opisującej szczegóły dotyczących praw autorskich dotyczących twojej wiki. W pliku $ls ustawienie $1 zawiera tytuł linku do tej strony a $2 lub $3 tytuł strony na wiki lub zewnętrzny URL. 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
- (polityka prywatności) - jest samym linkiem. Zmień MediaWiki:Privacy aby ustawić tytuł linku oraz MediaWiki:Privacypage aby podać tytuł strony, do której ma prowadzić link.
about
- (o stronie) - jest samym linkiem. Zmień MediaWiki:Aboutsite aby ustawić tytuł linku oraz MediaWiki:Aboutpage aby podać tytuł strony, do której ma prowadzić link.
disclaimer
- jest samym linkiem. Zmień MediaWiki:Disclaimers aby ustawić tytuł linku oraz MediaWiki:Disclaimerpage aby podać tytuł strony, do której ma prowadzić link.
tagline
- aktualnie nie jest używane w stopce If you would like to add text to the footer, see #Add text to the footer.
Aby usunąć całkowicie link do polityki prywatności, o stronie lub disclaimer zastąp tekst linku kreską ("-
").
Obrazki
- Zobacz $wgFooterIcons .