Extension:CategoryTests/pl

Category:GPL licensed extensions/pl
Podręcznik rozszerzeń MediaWiki
Category Tests
Status wydania: stabilneCategory:Stable extensions/pl
Realizacja Funkcja parsera Category:Parser function extensions/pl
Opis Provides a set of parser functions check for categories
Autor(zy) Ryan Schmidt (Skizzerzdyskusja)
Ostatnia wersja 1.6.0 (2017-10-28)
MediaWiki 1.32+Category:Extensions with manual MediaWiki version
PHP 5.3+
Licencja Licencja GNU General Public License 2.0 lub nowsza
Pobieranie Category:Extensions in Wikimedia version control/pl
Quarterly downloads 1 (Ranked 82nd)
Przetłumacz rozszerzenie CategoryTests jeżeli jest dostępne na translatewiki.net
Category:All extensions/pl

The CategoryTests extension provides a set of dynamic parser functions that check for categories.

Użycie

This currently defines 3 parser functions for category testing.

  • {{#ifcategory:category|then|else|page}}
Tests if the given page is in the category given, then displays "then" or "else" (or current page if no page is given).
  • {{#ifnocategories:then|else|page}}
Tests if the given page does not belong in any categories, then displays "then" or "else" (or current page if no page is given).
  • {{#switchcategory:category1=result1|category2=result2|...|default}}
Operates like the ParserFunctions #switch, but doesn't take an initial parameter (it just starts cycling through right away) and tests if the page is in those categories instead of comparing it to a value. You can specify to test other pages using #page=pagename, where it would then test that page instead of the current page until the next #page definition, in which case it will test that page now instead. Making #page empty resets it to the current page. If your default case needs an equals sign, you may use #default to declare it.

Instalacja

  • Pobierz i umieść plik(i) w katalogu o nazwie CategoryTests w folderze extensions/.
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTests
    
  • Dodaj poniższy kod na dole twojego pliku LocalSettings.php :
    wfLoadExtension( 'CategoryTests' );
    
  • Yes Zrobione – Przejdź do Special:Version na twojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.

Zobacz też

  • ParserFunctions - For more general conditional constructs
  • PageInCat - The main difference seems to be that PageInCat will always try to use categories from the current revision, while CategoryTests may sometimes use the categories from the previous revision, which could result in unexpected page content
Category:Category extensions/pl
Category:All extensions/pl Category:Category extensions/pl Category:Extensions in Wikimedia version control/pl Category:Extensions included in Miraheze/pl Category:Extensions with manual MediaWiki version Category:GPL licensed extensions/pl Category:ParserFirstCallInit extensions/pl Category:Parser function extensions/pl Category:Stable extensions/pl