Anpassa mallar

From Miraheze Developers Wiki
This page is a translated version of the page Customising templates and the translation is 83% complete.
Other languages:

Det är enklare att hämta högkvalitativa och komplicerade mallar från Wikipedia, eller liknande webbplatser (t.ex. MediaWiki) än att skapa dem från grunden. Avsevärt arbete har redan lagts på att utveckla och testa dem. Däremot är de oftast byggda för att fungera att fungera just där. På Miraheze Developers Wiki är mallarna menade att användas i allmänt bruk. Den här sidan förklarar hur man gör det.

Obligatoriska ändringar

Mallar specifika för en webbplats (som Wikipedia t.ex.) behöver anpassas för mer allmänt bruk:

  • Följ Wikimedias varumärkespolicy.
  • Byt ut Wikipedia i texten mot {{ns:Project}}, (eller, om lämpligt, Miraheze).
  • Byt ut Wikimedia i texten mot Miraheze.
  • Byt ut namnrymdslänkar t.ex. Wikipedia mot {{ns:Project}} eller meta.
  • *I Lua-modeller, byt ut Wikipedia mot ' .. mw.site.siteName .. ' för att till exempel ändra texten i {{stub}} i modul asbox rad 233 från:
' is a [[Wikipedia:stub|stub]]. You can help Wikipedia by [',

till:

' is a [[' .. mw.site.namespaces.Project.name .. ':stub|stub]]. You can help ' .. mw.site.siteName .. ' by [',
.
  • Remove assumptions about the structure of the wiki (such as a template producing an error when used in certain namespaces - you can't know what namespace configuration the target wiki will use) from both the code and the documentation.
  • Try to reduce the number of dependencies the template has. Templates with fewer, or ideally no, dependencies are easier to export to other wikis. If a template does have dependencies, note them on the doc page with {{dependencies}}.
  • Remove any red-linked categories and add the template to Category:Templates or an appropriate subcategory.

Ikoner

Miraheze-wikier är kompatibla med Instant Commons, annars skulle bilder på ikoner behöva laddas upp lokalt. En bra källa för ikonbilder är Wikimedia Commons Category:Icons by subject.

Licens

På grund av CC-BY-SA-licensiering måste överväganden av tidigare redaktörer erkännas. Här följer en lista över källor och attributionsmallar för att skriva in längst ner på sidor, (men inte undersidor) t.ex. innan </noinclude>:

Se även