Knowledge (XXG)

Template:Category other

Source 📝

24: 75: 387: 380: 373: 171:
A typical usage case could be to make it so that a template only adds a category when on category pages. Thus not adding other pages that just show the template. Like this:
851: 839: 39: 875: 835: 35: 891: 296:
parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:
896: 43: 216:
Note that in the first case above the "other" parameter was not used, and in the second example the "category" parameter was left empty.
821: 510: 846: 89: 737: 520: 101: 93: 871: 829: 807: 31: 749: 725: 570: 550: 527: 505: 479: 642: 515: 484: 354: 689: 654: 489: 464: 123:
This template helps other templates detect if they are on a "Category:" page or some "other" type of page.
97: 630: 618: 606: 474: 797: 792: 541: 402: 459: 454: 51: 432: 100:. The tested changes can be added to this page in a single edit. Consider discussing changes on the 701: 677: 469: 449: 442: 437: 422: 417: 761: 825: 773: 365: 594: 243:
or any other value such as the name of some other namespace it returns the other pages text.
802: 88:
To avoid major disruption and server load, any changes should be tested in the template's
713: 885: 246:
If the parameter is empty or undefined, the actual page type determines the result.
743:
Displays different content to extended confirmed and non-extended confirmed users.
582: 224:
For testing and demonstration purposes this template can take a parameter named
82: 284:
No matter on what kind of page the code above is used it will return this:
18: 360:, for more examples and technical details see full documentation there. 731:
Displays different content to autoconfirmed and non-autoconfirmed users.
600:
Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
779:
Detects whether page is viewed with a JavaScript-capable client or not.
369: 155:
If the template is on a "Category:" page, it will return this:
193:
Or to warn that a template should not be used on other pages:
69: 767:
Displays different content to mobile users and desktop users.
683:
Detects whether it is on a page with a stub template or not.
719:
Displays different content to IP users and logged-in users.
163:
If the template is on any other page, it will return this:
588:
Can take apart and put together pagenames in several ways.
556:
Detects and acts according to whether it is on a basepage
863: 855: 131:
This template usually takes two parameters, like this:
60: 292:
You can make it so your template also understands the
343:
This template detects "Category talk:" pages as type
209:
This template should only be used on category pages.
772: 760: 748: 736: 724: 712: 707:
Detects whether page is viewed as a preview or not.
700: 688: 676: 669: 653: 641: 629: 624:
Pagename has an after-slash part (not in mainspace)
617: 605: 593: 581: 569: 549: 540: 498: 410: 401: 660:Page is rootpage (vs. /subpage) (template space) 83:840,000+ pages, or roughly 1% of all pages 381: 8: 695:Detects whether it is on a redirect or not. 648:Page is subpage /testcases (template space) 845:Editors can experiment in this template's 673: 546: 407: 396:Namespace and pagename-detecting templates 388: 374: 366: 636:Page is subpage /sandbox (template space) 576:For pattern matching on the pagename. 7: 236:it returns the category page text. 14: 892:Namespace manipulation templates 755:Displays content only to admins. 73: 22: 1: 897:Category namespace templates 612:For detecting IP-user pages. 830:Template:Category other/doc 560:on any subpage (that is, a 913: 819: 49: 876:Subpages of this template 798:Knowledge (XXG):Page name 793:Knowledge (XXG):Namespace 788: 350:This template works like 104:before implementing them. 96:subpages, or in your own 81:This template is used on 511:Namespace detect showall 298: 252: 195: 173: 133: 870:Add categories to the 27:Template documentation 738:If extended confirmed 521:Main talk other flex 309:Category page text 263:Category page text 239:It if has the value 232:If it has the value 144:Category page text 313:Other pages text 288:Category page text 267:Other pages text 159:Category page text 816: 815: 784: 783: 665: 664: 536: 535: 339:Technical details 148:Other pages text 108: 107: 904: 867: 859: 843: 750:If administrator 726:If autoconfirmed 674: 571:When pagename is 563: 551:When on basepage 547: 528:Talkspace detect 506:Namespace detect 480:Single namespace 408: 390: 383: 376: 367: 359: 353: 334: 331: 328: 325: 322: 319: 316: 312: 308: 305: 302: 280: 276: 273: 270: 266: 262: 259: 256: 212: 208: 205: 202: 199: 189: 186: 183: 180: 177: 167:Other pages text 151: 147: 143: 140: 137: 119: 113: 77: 76: 70: 63: 47: 28: 26: 25: 912: 911: 907: 906: 905: 903: 902: 901: 882: 881: 880: 879: 869: 861: 849: 844: 833: 818: 817: 812: 808:ParserFunctions 780: 768: 756: 744: 732: 720: 708: 696: 684: 661: 649: 643:Testcases other 637: 625: 613: 601: 589: 577: 565: 561: 532: 516:Main talk other 494: 485:If talkspace of 397: 394: 363: 357: 355:main talk other 351: 341: 336: 335: 332: 329: 326: 323: 320: 317: 314: 310: 306: 303: 300: 282: 281: 278: 274: 271: 268: 264: 260: 257: 254: 222: 214: 213: 210: 206: 203: 200: 197: 191: 190: 187: 184: 181: 178: 175: 153: 152: 149: 145: 141: 138: 135: 129: 120:meta-template. 117: 111: 87: 74: 68: 67: 59: 54: 48: 29: 23: 21: 16: 12: 11: 5: 910: 908: 900: 899: 894: 884: 883: 860:and testcases 814: 813: 811: 810: 805: 800: 795: 789: 786: 785: 782: 781: 778: 776: 770: 769: 766: 764: 758: 757: 754: 752: 746: 745: 742: 740: 734: 733: 730: 728: 722: 721: 718: 716: 710: 709: 706: 704: 698: 697: 694: 692: 690:Redirect other 686: 685: 682: 680: 671: 667: 666: 663: 662: 659: 657: 655:Rootpage other 651: 650: 647: 645: 639: 638: 635: 633: 627: 626: 623: 621: 615: 614: 611: 609: 603: 602: 599: 597: 591: 590: 587: 585: 579: 578: 575: 573: 567: 566: 555: 553: 544: 538: 537: 534: 533: 531: 530: 525: 524: 523: 513: 508: 502: 500: 496: 495: 493: 492: 490:If usertalk of 487: 482: 477: 472: 467: 465:Template other 462: 457: 452: 447: 446: 445: 435: 430: 428:Category other 425: 420: 414: 412: 405: 399: 398: 395: 393: 392: 385: 378: 370: 340: 337: 304:category other 299: 290: 289: 258:category other 253: 248: 247: 244: 237: 221: 218: 201:category other 196: 179:category other 174: 169: 168: 161: 160: 139:category other 134: 128: 125: 115:category other 106: 105: 78: 66: 65: 55: 50: 20: 19: 13: 10: 9: 6: 4: 3: 2: 909: 898: 895: 893: 890: 889: 887: 877: 873: 865: 857: 853: 848: 841: 837: 831: 827: 823: 822:documentation 809: 806: 804: 801: 799: 796: 794: 791: 790: 787: 777: 775: 771: 765: 763: 759: 753: 751: 747: 741: 739: 735: 729: 727: 723: 717: 715: 711: 705: 703: 699: 693: 691: 687: 681: 679: 675: 672: 668: 658: 656: 652: 646: 644: 640: 634: 632: 631:Sandbox other 628: 622: 620: 619:Subpage other 616: 610: 608: 607:IP-user other 604: 598: 596: 592: 586: 584: 580: 574: 572: 568: 559: 554: 552: 548: 545: 543: 539: 529: 526: 522: 519: 518: 517: 514: 512: 509: 507: 504: 503: 501: 497: 491: 488: 486: 483: 481: 478: 476: 475:Project other 473: 471: 468: 466: 463: 461: 458: 456: 453: 451: 448: 444: 441: 440: 439: 436: 434: 431: 429: 426: 424: 421: 419: 416: 415: 413: 409: 406: 404: 400: 391: 386: 384: 379: 377: 372: 371: 368: 364: 361: 356: 348: 346: 338: 297: 295: 287: 286: 285: 251: 245: 242: 238: 235: 231: 230: 229: 227: 219: 217: 194: 172: 166: 165: 164: 158: 157: 156: 132: 126: 124: 121: 116: 103: 99: 95: 91: 85: 84: 79: 72: 71: 62: 57: 56: 53: 45: 41: 37: 33: 17: 557: 499:More generic 460:Portal other 455:Module other 427: 362: 358:}} 352:{{ 349: 344: 342: 293: 291: 283: 249: 240: 233: 225: 223: 215: 192: 170: 162: 154: 130: 122: 118:}} 114: 112:{{ 110:This is the 109: 98:user subpage 80: 64:}} 58:{{ 15: 826:transcluded 803:Magic words 583:Module:Page 433:Draft other 250:Like this: 42:] [ 38:] [ 34:] [ 886:Categories 820:The above 702:If preview 678:Stub other 470:User other 450:Help other 443:Is Commons 438:File other 423:Talk other 418:Main other 411:Particular 318:demospace 272:demospace 94:/testcases 874:subpage. 762:If mobile 564:subpage). 403:Namespace 327:demospace 294:demospace 277:category 226:demospace 220:Demospace 102:talk page 774:Noscript 542:Pagename 234:category 90:/sandbox 52:Shortcut 854:| 847:sandbox 840:history 838:| 595:IP-talk 40:history 868:pages. 864:create 670:Others 828:from 714:If IP 562:../.. 345:other 241:other 127:Usage 46:] 44:purge 30:[ 872:/doc 856:diff 852:edit 836:edit 330:|}}} 61:ns14 36:edit 32:view 824:is 324:{{{ 228:. 92:or 888:: 832:. 558:or 347:. 333:}} 301:{{ 279:}} 255:{{ 211:}} 198:{{ 188:}} 176:{{ 150:}} 136:{{ 878:. 866:) 862:( 858:) 850:( 842:) 834:( 389:e 382:t 375:v 321:= 315:| 311:| 307:| 275:= 269:| 265:| 261:| 207:| 204:| 185:] 182:| 146:| 142:| 86:.

Index

view
edit
history
purge
Shortcut
ns14
840,000+ pages, or roughly 1% of all pages
/sandbox
/testcases
user subpage
talk page
category other
main talk other
v
t
e
Namespace
Main other
Talk other
Category other
Draft other
File other
Is Commons
Help other
Module other
Portal other
Template other
User other
Project other
Single namespace

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.