Difference between revisions of "Meta:Templates"

From Synfig Studio :: Documentation
Jump to: navigation, search
(User Templates: Stub template)
(Internal Templates: Describe language bar templates)
Line 45: Line 45:
 
|Первые шаги
 
|Первые шаги
 
|Look at the source of {{l|Doc:Getting_Started/ru|Doc:Getting_Started/ru}} page.
 
|Look at the source of {{l|Doc:Getting_Started/ru|Doc:Getting_Started/ru}} page.
 +
|}
 +
 +
== Languages ==
 +
* '''Location''': {{l|Template:Languages}}
 +
* '''Description''': Displays bar listing available translations for current page. {{l|Template:Languages|More...}}
 +
* '''Examples''': <nowiki>{{{Languages}}}</nowiki>
 +
 +
== Languages/Lang ==
 +
* '''Location''': {{l|Template:Languages/Lang}}
 +
* '''Description''': Utility template for language bar. Generates link to specified translation of current page if it's exists.
 +
* '''Examples''':
 +
{| width="100%"
 +
|+
 +
|'''Code:'''
 +
|'''Result:'''
 +
|'''Comments:'''
 +
|-
 +
|<nowiki>{{Languages/Lang|en}}</nowiki>
 +
|{{Languages/Lang|en}}
 +
|Result is "English", but without a link, because current page is in English
 +
|-
 +
|<nowiki>{{Languages/Lang|es}}</nowiki>
 +
|{{Languages/Lang|es}}
 +
|Result is empty, because this page have no Spanish translation. If it does, then the result would be: " &bull; {{l|Meta:Templates/es|Español}}"
 +
|-
 +
|<nowiki>{{Languages/Lang|ru}}</nowiki>
 +
|{{Languages/Lang|ru}}
 +
|Result is empty, because this page have no Russian translation. If it does, then the result would be: " &bull; {{l|Meta:Templates/ru|Русский}}"
 +
|}
 +
 +
== Languages/ThisPageTranslatedIn ==
 +
* '''Location''': {{l|Template:Languages/ThisPageTranslatedIn}}
 +
* '''Description''': Utility template for language bar. Returns a page name which translates current page to specified language.
 +
* '''Examples''':
 +
{| width="100%"
 +
|+
 +
|'''Code:'''
 +
|'''Result:'''
 +
|'''Comments:'''
 +
|-
 +
|<nowiki>{{Languages/ThisPageTranslatedIn|en}}</nowiki>
 +
|{{Languages/ThisPageTranslatedIn|en}}
 +
|If this template invoked from Meta:Templates/es, then result is the same ("/es" suffix automatically dropped)
 +
|-
 +
|<nowiki>{{Languages/ThisPageTranslatedIn|ru}}</nowiki>
 +
|{{Languages/ThisPageTranslatedIn|ru}}
 +
|If this template invoked from Meta:Templates/es, then result is the same ("/es" suffix automatically dropped and "/ru" suffix added)
 
|}
 
|}
  

Revision as of 07:57, 10 February 2010

Here's a list of templates used to improve this wiki functionality.

User Templates

Those templates can (and often should) be used in page body.

Category

  • Location: Template:Category
  • Description: Specifies category page belongs to.
  • Examples: {{Category|MyCategory}}.

CategoryContents

  • Location: Template:CategoryContents
  • Description: Lists all pages in the specified category. Output is localized, so if you use {{CategoryContents|Example}} on Spanish page, you will automatically get content of Example/es category and the page titles will be replaced with their Spanish translations.
  • Examples: {{CategoryContents|MyCategory}}.

L

  • Location: Template:L
  • Description: Creates link to another page, providing proper localization support.
  • Examples: See Meta:LinksTest/ru.

Stub

  • Location: Template:Stub
  • Description: Mark page as a stub.
  • Examples: {{Stub}}.

Title

Internal Templates

Templates below are not intended for direct use in page body. They are usually invoked by high-level templates listed above.

GetTitle

  • Location: Template:GetTitle
  • Description: Returns custom title of a page set with {{Title}} template in the page body.
  • Examples:
Code: Result: Comments:
{{GetTitle|Doc:Getting_Started/ru}} Первые шаги Look at the source of Doc:Getting_Started/ru page.

Languages

  • Location: Template:Languages
  • Description: Displays bar listing available translations for current page. More...
  • Examples: {{{Languages}}}

Languages/Lang

  • Location: Template:Languages/Lang
  • Description: Utility template for language bar. Generates link to specified translation of current page if it's exists.
  • Examples:
Code: Result: Comments:
{{Languages/Lang|en}} English Result is "English", but without a link, because current page is in English
{{Languages/Lang|es}} Result is empty, because this page have no Spanish translation. If it does, then the result would be: " • Español"
{{Languages/Lang|ru}} Result is empty, because this page have no Russian translation. If it does, then the result would be: " • Русский"

Languages/ThisPageTranslatedIn

Code: Result: Comments:
{{Languages/ThisPageTranslatedIn|en}} Meta:Templates If this template invoked from Meta:Templates/es, then result is the same ("/es" suffix automatically dropped)
{{Languages/ThisPageTranslatedIn|ru}} Meta:Templates/ru If this template invoked from Meta:Templates/es, then result is the same ("/es" suffix automatically dropped and "/ru" suffix added)

PagenameFromLink

Code: Result: Comments:
{{PagenameFromLink|Doc:Getting_Started#Introduction}} Doc:Getting_Started
{{PagenameFromLink|layers}} Layers
{{PagenameFromLink|:Category:Manual}} Category:Manual

Title.dpl


Title.dpl.default