Použití substituční šablony ARTICLE/en
{{ARTICLE}} is a substitution template for easily creating new articles and easily adding code for automatic transcluse and multilingual use of existing articles.
<section end=main />
Using
When creating a new page, you may notice a box Vyberte nápis generated by the Multiboilerplate extension, which contains a drop-down menu for selecting a template name that can be loaded into an empty editor window.
The loaded code from {{ARTICLE}} will look like this:
<!-- 1. stage
{{#ifeq:{{NUMBEROFSUBPAGES:Translations:{{FULLPAGENAME}}}}|0|{{int:languageofsource|{{PAGELANGUAGE}}}}|}}
1. stage -->
<!-- 3. stage
<!--noinclude><!--languages />
<!--translate><!--tvar name="1">
3. stage -->
<!-- 2. stage
{{GTrans
| {{subst:FULLPAGENAME}}
| {{subst:PAGELANGUAGE}}
}}
[[Kategorie:ToDo]]
2. stage -->
<!-- 3. stage
<!--/tvar><!--/translate><!--/noinclude>
3. stage -->
<section begin=news /><section begin=main />{{lastedit|{{subst:FULLPAGENAME}}{{subst:!}}}}
__NOTOC__
<!-- START OF PEREX -->
<!-- END OF PEREX --><section end=news /><section end=main />
<!-- includeonly --><section begin=main />{{right{{subst:!}}{{int:article-continue}} {{ll{{subst:!}}{{subst:FULLPAGENAME}}}}}}<section end=main /><!-- /includeonly -->
You can edit the loaded code directly and by using the Ukázat náhled button do continuously check, if result is ok, before page be actually created.
If article already exists, you must first insert template content by a substitution.
The Multiboilerplate extension generates a drop-down menu with a selection of templates to load only when creating a new page.
{{subst:ARTICLE}}
The first stage of processing – add the content
The first phase, it's creation the content of the page, and template do easy it.
If it is in Czech, we can safely remove the code delimited by lines where stage 1. is specified, if the default wiki language of TheWoodcraft.org is cs (čeština).
If you want a write in a different language, or if you have inserted the template into a page for which you do not know the default language, remove only the lines containing 1. stage and do preview.
The information box will be appeared and the current default language of the page is showed.
If will be the language same as language of the content, delete line of code what generate this box,
or close it between strings <!-- 1. stage … 1. stage -->, as comment.
But if you want to point out that the page's default language needs to be changed, leave it as is. It will stop appearing once the page reaches stage three and be marked for translation.
During the first phase, the content is created.
The line where is 2. stage --> move before the line where is [[Kategorie:ToDo]], and either replace it with our own category, or add another.
- Categorization
- Category determine where the article will be displayed. Jen to záležitostí parametrů šablony
{{content}}, ve které lze nastavit různé ID perexu, což dovoluje psát v rámci jedné stránky více perexů. Výchozí identifikátorynewsamainvymezují bloky textu, s nimiž bude pracovat šablona{{content}}na hlavní stránce wiki TheWoodcraft.org, ale to, zdali se odkaz na stránku někde zobrazí, včetně příslušného perexu, závisí především na čase poslední změny a kategorii do které je stránka kategorizována. See Nápověda:Kategorizace – Výchozí kategorie Kategorie:ToDo může být na stránce ponechána, dokud neusoudíte, že obsah stránky dosáhnul finální podoby. - Perex
- Je část obsahu stránky, vymezená elementem
section, jehož atributybegin=aend=, mají-li shodný identifikátor, určují co z kódu se má zahrnout. O využití perexu se podrobně píše na stránce Uživatel:Keny/ Uživatelské stránky. V případě šablony{{ARTICLE}}bude součástí perexu pouze část vymezená komentáři, ve kterých se vyskytuje slovo PEREX. Ale nic nebrání tomu, aby byl zobrazovaný perex sestaven z z různých částí odkazovaného dokumentu.
Druhá fáze - zobrazování informačního bloku s odkazem na on-line překladač
Ke druhé fázi můžeme přistoupit ve chvíli, kdy už je definitivně jasné, jak se bude stránka jmenovat, protože při uložení kódu dojde k substituci (nahrazení) názvu a jazykového kódu stránky.
Odstraňte řádky na kterých je uvedeno 2. stage a změnu uložte.
Od té chvíle se bude přes Widget:GoogleTranslate, v záhlaví generovat odkaz na automatický překlad stránky z výchozího jazyka do aktuálně zvoleného jazyka rozhraní.
Třetí fáze – příprava obsahu stránky na překlad
Během druhé fáze, se rozhodujeme, budeme-li obsah stránky překládat, nebo si vystačíme jen s automatickým překladem.
Usoudíme-li, se stojí za to obsah překládat, je potřeba odstranit řádky na kterých je uvedeno 3. stage a u značkovacího párového elementu translate odstranit řetězce !-- a wiki s ním začne pracovat.
To, jak označkovat zbytek obsahu, podrobně rozebírá Nápověda:Jazykové mutace stránek
Šablonu {{GTrans}} můžeme na stránce ponechat a pokud bude některý z překladů obsahovat více informací než originál, můžeme pomocí kódu jazyka ovlivnit to, jakou jazykovou verzi má automatický překladač použít jako výchozí.
3. stage, ale také element languages a párový, značkovací element translate.