Yardım:Sihirli kelimeler

Vikipedi, özgür ansiklopedi
Şuraya atla: kullan, ara
Kısayol:

Sihirli kelimeler (hareket anahtarları, değişkenler ve çözümleyici işlevler içeren) MediaWiki yazılımında kullanılabilecek çeşitli talimatları etkinleştirmeye yarayan wikitext özelliklerdir. Örneğin bir maddedeki içindekiler tablosunu bastırmak ya da konumlandırmak için kullanılabilirler. Ayrıca Şablon benzeri çeşitli çıkışların üretilmesini sağlamak amacı taşırlar.

Sihirli kelimeler için kaynakları bu sayfada bulabilirsiniz. Daha eksiksiz ve güncel belgeler için, MediaWiki sitesinden aşağıdaki sayfaları inceleyiniz:

Genel bilgilendirme[değiştir | kaynağı değiştir]

Sihirli kelimelerin üç tipi bulunmaktadır:

  • Hareket anahtarları: büyük harflerle yazılmış kelimeler çift alt çizgiler ile çevrilmiştir. Örneğin; __NOTOC__
  • Değişkenler: büyük harflerle yazılmış kelimeler çift kaşlı ayraçlar ile çevrilmiştir. Örneğin; {{PAGENAME}}
  • Çözümleyici işlevler: anahtar kelimelerin (bazıları # işaretiyle başlar) devamında yer alan iki nokta üst üste ve diğer parametreler sonunda çift kaşlı ayraçlar ile çevrilmiştir. Örneğin; {{#expr:2+2}}

Bazı sihirli kelimeler büyük harf-küçük harf değişimine duyarsızdır, ancak hepsi böyle değildir. Beyaz boşluklar çoğu kez kaşlı ayraçlar ile diğer parametreler arasında ise sihirli kelimeyi bozmaz, ancak sihirli kelimelerin veya diğer parametrelerin içinde beyaz boşluk yer alırsa çoğu kez kullanımın işlevselliğini bozar.

Hareket anahtarları[değiştir | kaynağı değiştir]

Bir hareket anahtarı sayfa düzenini denetler ve genellikle düzeltilmesi istenen eksiklikleri ve içeriğe ilişkin hareketleri belirtmek için kullanılabilir. Daha çok bilgi için sihirli kelimelerler ilgili hareket anahtarlarına ilişkin MediaWiki sayfasını inceleyiniz.

  • __NOTOC__ (can appear anywhere in the wikitext; suppresses the table of contents)
  • __FORCETOC__ (can appear anywhere in the wikitext; makes a table of contents appear in its normal position above the first header)
  • __TOC__ (places a table of contents at the word's position)
  • __NOEDITSECTION__ (hides the section "edit" links beside all headings on the page) (use <h2> tags to hide the edit link for one header only)
  • __NEWSECTIONLINK__ (adds a "+" link for adding a new section on a non-"Talk" page)
  • __NONEWSECTIONLINK__ (removes the "+" link on "Talk" pages)
  • __NOGALLERY__ (on a category page, replaces thumbnails with normal links)
  • __HIDDENCAT__ (on a category page, makes it a hidden category)
  • __INDEX__ (tells search engines to index the page)
  • __NOINDEX__ (tells search engines not to index the page)
  • {{DISPLAYTITLE:title}} (changes the displayed form of the page title)
  • {{DEFAULTSORT:sortkey}} (sets a default category sort key)

Değişkenler[değiştir | kaynağı değiştir]

Değişkenler, geçerli ve güncel sayfadaki, viki ve/veya tarih bilgileri hakkında bilgileri döndürür ve güncel tutar. Daha çok bilgi için sihirli kelimelerler ilgili değişkenlere ilişkin MediaWiki sayfasını inceleyiniz.

  • {{FULLPAGENAME}} (page title including namespace)
  • {{PAGENAME}} (page title excluding namespace)
  • {{BASEPAGENAME}} (page title excluding current subpage and namespace - effectively the parent page without the namespace.)
  • {{SUBPAGENAME}} (subpage part of title)
  • {{SUBJECTPAGENAME}} (associated non-talk page)
  • {{TALKPAGENAME}} (associated talk page)
  • {{NAMESPACE}} (namespace of current page)
  • {{SUBJECTSPACE}}, {{ARTICLESPACE}} (associated non-talk namespace)
  • {{TALKSPACE}} (associated talk namespace)
  • {{FULLPAGENAMEE}}, {{NAMESPACEE}} etc. (equivalents encoded for use in MediaWiki URLs)
  • {{SITENAME}} (Vikipedi)
  • {{SERVER}} (//tr.wikipedia.org)
  • {{SERVERNAME}} (tr.wikipedia.org)
  • {{SCRIPTPATH}} (/w)
  • {{CURRENTVERSION}} (current MediaWiki version)
  • {{REVISIONID}} (latest revision to current page)
  • {{REVISIONDAY}}, {{REVISIONDAY2}}, {{REVISIONMONTH}}, {{REVISIONYEAR}}, {{REVISIONTIMESTAMP}}, {{REVISIONUSER}} (date, time, editor at last edit)
  • {{CURRENTYEAR}}, {{CURRENTMONTH}}, {{CURRENTMONTHNAME}}, {{CURRENTMONTHABBREV}}, {{CURRENTDAY}}, {{CURRENTDAY2}}, {{CURRENTDOW}}, {{CURRENTDAYNAME}}, {{CURRENTTIME}}, {{CURRENTHOUR}}, {{CURRENTMINUTE}}, {{CURRENTWEEK}}, {{CURRENTTIMESTAMP}} (current date/time variables)
  • {{LOCALYEAR}} etc. (as above, based on site's local time)
  • {{NUMBEROFPAGES}}, {{NUMBEROFARTICLES}}, {{NUMBEROFFILES}}, {{NUMBEROFEDITS}}, {{NUMBEROFVIEWS}}, {{NUMBEROFUSERS}}, {{NUMBEROFADMINS}}, {{NUMBEROFACTIVEUSERS}} (statistics on English Wikipedia; add :R to return numbers without commas)

Çözümleyici işlevler[değiştir | kaynağı değiştir]

Çözümleyici işlevler, değişkenlere çok benzer ancak bir veya daha fazla parametre daha fazladırlar. Teknik olarak herhangi bir sihirli kelime bir parametre aldığında bir çözümleyici işlev olduğunu ortaya koyar. Bazen bir çözümleyici işlev olan sihirli kelimeyi diğer şablonlardan ayırmak için ismine bir ön ek eklenebilir. Bu sihirli kelimeler herhangi bir şekilde sayfa düzeni ve bilgi döngüsünde etkili olabilir. Daha çok bilgi için sihirli kelimelerler ilgili çözümleyici işlevlere ilişkin MediaWiki sayfasını inceleyiniz.

Metadata[değiştir | kaynağı değiştir]

  • {{PAGESIZE:sayfa adı}} (byte olarak sayfanın boyutu)
  • {{PROTECTIONLEVEL:eylem}} (mevcut sayfada verilen eylem için koruma seviyesi)
  • {{PAGESINCATEGORY:kategori adı}} (ilgili kategorideki sayfa sayısı)
  • {{NUMBERINGROUP:grup adı}} (belirli bir gruptaki kullanıcı sayısı)

Sayıları virgülden kurtarmak için |R ekleyin.

Formatting[değiştir | kaynağı değiştir]

  • {{lc:string}} (convert to lower case)
  • {{lcfirst:string}} (convert first character to lower case)
  • {{uc:string}} (convert to upper case)
  • {{ucfirst:string}} (convert first character to upper case)
  • {{formatnum:unformatted num}} (format a number with comma separators; add |R to unformat a number)
  • {{#formatdate:date|format}} (formats a date according to user preferences; a default can be given as an optional case-sensitive second parameter for users without date preference; can convert a date from an existing format to any of dmy, mdy, ymd or ISO 8601 formats, with the user's preference overriding the specified format)
  • {{padleft:xyz|stringlength}}, {{padright:xyz|stringlength}} (pad with zeros to the right or left; an alternative padding string can be given as a third parameter; the alternative padding string may be truncated if its length does not evenly divide the required number of characters)
  • {{plural:n|is|are}} (produces alternative text according to whether n is greater than 1)
  • {{#time:format string|date/time object}} (for date/time formatting; also #timel for local time. Covered at the extension documentation page.)
  • {{gender:username|masculine|female|neutral}} (produces alternative text according to the gender specified by the given user in his/her preferences)
  • {{#tag:tagname|content|parameter1=value1|parameter2=value2}} (equivalent to an HTML tag or pair of tags; can be used for nesting references)

Paths[değiştir | kaynağı değiştir]

  • {{localurl:page name}}, {{localurl:page name|query string}} (relative path to the title)
  • {{fullurl:page name}}, {{fullurl:page name|query_string}} (absolute path to the title)
  • {{filepath:file name}} (absolute URL to a media file)
  • {{urlencode:string}} (input encoded for use in URLs)
  • {{anchorencode:string}} (input encoded for use in URL section anchors)
  • {{ns:n}} (name for the namespace with index n; use {{nse:}} for the equivalent encoded for MediaWiki URLs)
  • {{#rel2abs: path }} (converts a relative file path to absolute; see the extension documentation)
  • {{#titleparts: pagename | number of segments to return | first segment to return }} (splits title into parts; see the extension documentation)

Conditional expressions[değiştir | kaynağı değiştir]

These are covered at the extension documentation page. Some parameters are optional.

  • {{#expr: expression }} (evaluates the given expression; see Help:Calculation)
  • {{#if: test string | value if non-empty | value if empty }} (selects one of two values based on whether the test string is empty)
  • {{#ifeq: string 1 | string 2 | value if equal | value if unequal }} (selects one of two values based on whether the test strings are equal – numerically if applicable)
  • {{#iferror: test string | value if error | value if correct }} (selects value based on whether the test string generates a parser error)
  • {{#ifexpr: expression | value if true | value if false }} (selects value based on evaluation of expression)
  • {{#ifexist: page title | value if exists | value if doesn't exist }} (selects value depending on whether a page title exists)
  • {{#switch: test | case1 = value for case 1 | ... | default }} (provides alternatives based on the value of the test string)

For the use of these functions in tables, see Conditional tables.

Türkçe karşılıklar[değiştir | kaynağı değiştir]


Ayrıca bakınız[değiştir | kaynağı değiştir]