Help:Categories - MediaWiki

文章推薦指數: 80 %
投票人數:10人

You can categorize pages and files by adding one or more Category tags to the content text. These tags create links at the bottom of the ... Jumptocontent Namespaces HelpDiscussion English expanded collapsed Views ReadViewsourceViewhistory More expanded collapsed Navigation MainpageGetMediaWikiGetextensionsTechblogContribute Support UserhelpFAQTechnicalmanualSupportdeskCommunication Development BugtrackerCodedocsCoderepositoryStatistics MediaWiki.org CommunityportalRecentchangesTranslatecontentRandompageVillagepumpSandbox Tools WhatlinkshereRelatedchangesUploadfileSpecialpagesPermanentlinkPageinformationWikidataitem Print/export CreateabookDownloadasPDFPrintableversion Inotherprojects WikimediaCommonsMeta-WikiWikibooksWikinewsWikipediaWikiquoteWikisourceWikiversityWiktionary Inotherlanguages AlemannischتۆرکجهБашҡортсаBoarischБеларускаяभोजपुरीCatalàکوردیČeštinaCymraegDanskDeutschΕλληνικάEnglishEsperantoEspañolEestiEuskaraفارسیFrançaisGalegoՀայերենBahasaIndonesiaIlokanoÍslenskaItaliano日本語ភាសាខ្មែរRipoarischLëtzebuergeschमराठीBahasaMelayuNederlandsNorskਪੰਜਾਬੀPolskiپښتوPortuguêsRomânăРусскийScotsسنڌيSimpleEnglishSlovenčinaSlovenščinaShqipSvenskaதமிழ்తెలుగుTürkçeТатарча/tatarçaУкраїнськаاردوYorùbá中文Bân-lâm-gú Editlinks Help:Categories Frommediawiki.org TranslatethispageOtherlanguages:BahasaIndonesia Bân-lâm-gú Cymraeg Deutsch English Esperanto Ido Interlingue Lëtzebuergesch Nederlands Ripoarisch Scots Sunda Taqbaylit TiếngViệt Türkçe Zazaki azərbaycanca català dansk español français galego isiXhosa italiano kurdî latviešu lietuvių norskbokmål occitan polski português portuguêsdoBrasil română sicilianu slovenčina suomi svenska čeština Ελληνικά български македонски русский српски/srpski українська ייִדיש עברית العربية سنڌي فارسی پښتو کوردی अंगिका अवधी हिन्दी বাংলা ਪੰਜਾਬੀ മലയാളം ไทย ဖၠုံလိက် ဘာသာမန် 中文 日本語 한국어 Note:Whenyoueditthispage,youagreetoreleaseyourcontributionundertheCC0.SeePublicDomainHelpPagesformoreinfo. Translate Categories,asoftwarefeatureofMediaWiki,provideautomaticindexesthatareusefulastablesofcontents. YoucancategorizepagesandfilesbyaddingoneormoreCategorytagstothecontenttext.Thesetagscreatelinksatthebottomofthepagethattakeyoutothelistofallpagesinthatcategory,whichmakesiteasytobrowserelatedarticles. Contents 1Summary 2Addingapagetoacategory 2.1Sortkey 3Creatingacategorypage 4Managingthecategoryhierarchy 4.1Categorytree 5Hiddencategories 6Linkingtoacategory 7Categoriesandtemplates(transcludedpages) 8Redirectingacategory 9Trackingcategories 10Renamingacategory 11Seealso Summary EachofthepagesintheCategorynamespacerepresentsaso-calledcategory,agroupingofrelatedpages,andcontainsanindexforthepagesofitscategory.Forexample,thispagebelongsto"Category:Help".Ifyouopenthecategorypage,youwillseealinktothispagethere. Whenapagebelongstooneormorecategories,thesecategoriesappearatthebottomofthepage(orintheupper-rightcorner,dependingontheskinbeingused). Thecategorypagesthemselvescontain2parts: attheirbeginning,anoptionalpartmaycontaintextthatcanbeedited,likeanyotherpage, attheirend,aneverpresent,automaticallygenerated,alphabeticallistofallpagesinthatcategory,intheformoflinks.Infact,intheUnicodesortorder. Toassignacategorytoapage,simplyaddthelink"[[Category:Categoryname]]"tothepage'swikitext.Theusualplacetoadditisatthebottomofthepage. Tolinkacategorypagewithinapageasanormalwikilink(withoutaddingthepagetothecategory),prefixthelinknamewithacolon.Forexample:[[:Category:Notinthiscategory]] Anewcategorycanbecreatedbeforeassigninganypagetoit,inthesamewayasanyotherregularpage. Individualwikismayhavetheirowntop-levelcategories,suchasCategory:ContentsonWikipedia. Foracompletelistofallcategorieswhichhaveatleastonepage,seeSpecial:Categories. Foracompletelistofallcreated/editedcategories,includingtheonesthatdon'thaveanypages,seeSpecial:Allpages/Category:(notethecolonattheend). Addingapagetoacategory Toaddapageoruploadedfiletoacategory,simplyeditthepageandaddthefollowingtext(whereNameisthenameofthecategoryyouwanttoadditto). [[Category:Name]] AnynumberofCategorytagsmaybeaddedtothepageandthepagewillbelistedinallofthem.Categorytags,alongwithinterwikilanguagelinksplacedinthesidebar,areusuallyaddedattheverybottomofthepagefortheconvenienceofothereditors. Onacategorizedpage,categoriesaredisplayedintheCategories:boxstrictlyintheordertheyappearinthewikitext. If$wgUseCategoryBrowserissettotrue,underthefirstlisteachcategoryislistedagain,breadcrumb-style,withallitsparentcategories,sortedalphabetically. (AtleastinMediaWiki1.18.2)ifacategoryisasubcategoryofmorethanoneparent,bothhierarchieswillbelisted,butthetaggedcategorywillbestrippedoffallbutoneofthese. Thiscreatesthepotentialforwhatappeartobeduplicateentriesifacategorywithmultipleparentsandoneofitsparentsarebothtaggedonapage. ForexamplesupposeMaryanneisasubcategoryofbothMaryandAnne. IfapagetagscategoriesMaryanneandAnnethentheCategorybreadcrumbswillshow Anne Anne Mary->Maryanne "Anne"appearstobeduplicated,butwhatismeantis Anne Anne->Maryanne Mary->Maryanne Thisisabug,andhasbeenreportedinphab:T35614. Sortkey Bydefault,apageissortedwithinacategoryunderthefirstletterofitsname—withoutthenamespace. Also,MediaWikigroupsaccentedcharactersseparatelyfromtheirunaccentedversion,sopagesstartingbyÀ,Á,Ä,willbelistedunderseparateheadings,insteadofunderheadingA. (Ifyouhaveshellaccess,thesedefaultscanbechangedusing$wgCategoryCollation.) Asortkeyspecifiesunderwhichletterheading,andwhereinthecategorylist,thepagewillappear.Youcanaddasortkeybyplacingitinsidethetagafterapipecharacter.Forexample,thetagbelowwilladdthepageunderheading"S". [[Category:Name|Sort]] Whetherornotsortkeysarecase-sensitivedependsonyourconfigurationsettings. TheorderofthesectionswithinacategoryfollowstheUnicodesortorder.Thesortkeydoesnotchangethepagetitledisplayedinthecategory. Spacesandothercharactersareperfectlyvalid. SeeHelp:Sortingforfurtherinformationoncategorysorting. Creatingacategorypage Categoriesexisteveniftheirpagehasnotbeencreated,butthesecategoriesareisolatedfromothersandservelittlepurposefororganizationornavigation. AcategoryiscreatedbycreatingapageintheCategory:namespace.Acategorypagecanbecreatedthesamewayasotherwikipages(seeHelp:Startinganewpage);justadd"Category:"beforethepagetitle. Toavoidextrawork,trysearchingwithinyourwikibeforecreatinganewcategory.Thelistofallcategoriescanbefoundin"Specialpages"inthe"tools"boxofthesidebar. Managingthecategoryhierarchy Categoriesmaybelongtoothercategoriesinahierarchy.Sincecategorypagesaremuchlikeanyotherpage,aCategorytagmaybeaddedtothebottomofacategorypage. Itisagoodideatoorganizeallcategoriesintoahierarchywithasingletoplevelcategory.Thecategorystructurecantaketheformofatreewithseparatebranches,butmoreoftenwillhaveagraphstructure.Generally,thereshouldbeacontiguouschainofparent-childlinksbetweeneachcategoryandthetoplevelcategory. Categorytree Mainpage:CategoryTreeextensionmanual SinceMediaWiki 1.31,CategoryTreeextensionispackagedbydefault,allowingSpecial:CategoryTreeand‎toprovideatree-likestructuredisplayforthecategories. Hiddencategories Thecategoriesthatapageisinarenormallylistedatthebottomofthepage.InMediaWiki1.13+,acategorycanbehiddenfromthislistbyaddingthemagicword"__HIDDENCAT__"tothecategorypage. Userscanchoosetoseehiddencategoriesinaseparate"Hiddencategories"list,bychecking"Showhiddencategories"inthe"Appearance"sectionofSpecial:Preferences. HiddencategoriesareautomaticallyaddedtoCategory:Hiddencategories. ThiscategoryisspecifiedinthesystemmessageMediaWiki:Hidden-category-category. Linkingtoacategory Tocreatealinktoacategory,usealeadingcolonbeforethecategoryname(withoutthiscolon,thecurrentpagewouldbeaddedtothecategory): [[:Category:Help]]→Category:Help Tochangethelinktext,writethetextinsidethelinktagafterapipe: [[:Category:Help|Helpcategory]]→Helpcategory Redirectpagesthatredirecttocategoriesmustalsousethecolon,otherwisetheywillbeaddedtothecategoryinsteadofredirecting. Categoriesandtemplates(transcludedpages) Ifyouadd[[Category:Cats]]insideatemplate(atranscludedpage),boththetemplateandpageswhichtranscludethistemplatewillbecategorizedasCats. Ifyouwantonlythetemplatetobecategorized,youshouldensuretowritecategorymarkerinsidetags. Ifyouwantonlythepageswhichusesthetemplatetobecategorized,butnotthetemplateitself,youshouldensuretowritecategorymarkerinsidetags. Duetocachingissues,editingcategoriesappliedthroughtemplatesmaytakeawhiletobevisibleeverywhere. Youcanperformanulleditonapagetoupdateimmediatelyitscategories. Redirectingacategory Likenormalwikipages,categorypagescanberedirectedtoothernormalorcategorypages.However,thisisnotrecommended,aspagescategorizedinredirectedcategoriesdonotgetcategorizedinthetargetcategory(phab:T5311).SomeWikimediasitesusea"categoryredirect"templatetomarkredirectedcategories,allowingmanualorautomatedcleanupofpagescategorizedthere. Trackingcategories Certainsyntaxissues,suchasabrokenimagelink,ortoomanyexpensiveparserfunctions,cancauseapagetobeaddedtoatrackingcategory. SeeHelp:Trackingcategoriesfordetails. Renamingacategory Ifyoumoveacategory,sinceredirectwillnotworkforcategorizing,allcategorytagswillbewrong,soyouhavetofixthem. Seealso Category:Categoryextensions Retrievedfrom"https://www.mediawiki.org/w/index.php?title=Help:Categories&oldid=5039769" Categories:HelpCategory



請為這篇文章評分?