Kategorie:Šablony užívající SubpageFun

Z thewoodcraft.org

Rozšířením SubpageFun bylo nahrazeno na TheWoodcraft.org od MediaWiki verze 1.35 původně používané rozšíření SubPageList. Subpage Fun oproti němu podporuje celou sadu „kouzelných slov”, které lze dále parametrizovat. Např. {{NUMBEROFSUBPAGES: Pagename}} zobrazí počet podstránek stránky Pagename

{{SUBPAGETITLE}} zobrazí skutečný název podstránky, bez počátečního zpětného lomítka (/), podobně jako kouzelné sůvko SUBPAGENAME
{{SUBPAGES}} zobrazí úroveň podstránky. Stránka, co není podstránkou vrací 0.
{{TOPLEVELPAGE}} zobrazí pouze jméno výchozí stránku na úrovni 0.
{{PARENTPAGES}} zobrazí seznam jmén všech stránek, co mají další podstránky (potomky). Jednotlivé položky jsou odděleny čárkou.
{{SIBLINGPAGES}} zobrazí strom potomků na příslušných úrovních.
{{NUMBEROFSUBPAGES}} Vrací počet podstránek. Lze dále parametrizovat

Poznámka: Výstupem {{SUBPAGES}}, {{PARENTPAGES}}, {{SIBLINGPAGES}} je seznam, který lze dále zpracovávat např. přes rozšíření Arrays.

If one function is used with parameter 1 on a page with invalid characters, the output value will be an empty string.

Advanced formatting

There are several more parameters for some functions beside 1 which is available for all functions and allows to define the page to get the information from.

linked
If this parameter has any value at all the pages in the list of list generating functions become links
sep
Allows to define a different list separator than the default separator ,
depth
Works with {{SUBPAGES}}, {{NUMBEROFSUBPAGES}} and {{PARENTPAGES}}. It allows to define the relative depth to the most distant page. If the depth is set to a value smaller than 0 or not set, the functions will output everything, for {{PARENTPAGES}} a negative value will return that many elements starting from the top-level page.
filter
Works with {{SUBPAGES}}, {{PARENTPAGES}}, {{SIBLINGPAGES}} and {{NUMBEROFSUBPAGES}}. This parameter allows to define a regular expression (allowed delimiters /%|, allowed modifiers imsSuUx) which will filter all elements out of the list who don't match the expression. Alternatively, it is possible to define a simple word which must be part of a list entry or the entry won't be outputted. It is possible to define several words separated by an escaped | for example with help of a template like Template:! using {{!}}.
Examples:
  • {{PARENTPAGES: linked=true |depth=1}} will output the current page's direct parent page as link.
  • {{PARENTPAGES: <page> |depth=-1}} will give the same result as {{TOPLEVELPAGE}} with the only difference that if <page> is the top-level page already, an empty string is returned.
  • {{SUBPAGES: somepage |depth=1 |sep=<nowiki> </nowiki>}} will output all direct subpages below somepage seperated by a simple space.

Stránky v kategorii „Šablony užívající SubpageFun“

Zobrazují se 3 stránky z celkového počtu 3 stránek v této kategorii.