Knowledge (XXG)

Template:Category other/sandbox

Source 📝

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

Index

Template:Category other
template sandbox
Template:Category other
diff
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

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