Appropedia:Templates
This page describes the current template conventions on Appropedia. For a guide on how to use templates, see Help:Templates.
General guidelines
[edit | edit source]- Minimize templates - Templates make pages more difficult to edit, so use only when necessary or appropriate.
- Use simple and intuitive names - For example Template:Notice instead of Template:Mbox (as in Wikipedia).
- Avoid anonymous parameters - Named parameters are easier to understand and maintain.
- Use lowercase and dashes in parameter names - For example
access-dateinstead ofaccessDateor any other variant. - Use meta templates when appropriate - Meta templates unify templates throughout Appropedia. They also make site-wide improvements easy.
- Parameter values in content pages should be plain text - All wikitext should be hidden behind the template. This makes content editing easier and allows template developers to improve the processing of the values behind the scenes, without having to edit the content pages. Nested templates in content pages are especially undesirable, since they can't be edited with the visual editor.
- Use sensible defaults - Avoid required parameters whenever possible (example).
- Correlate parameter names and semantic properties - If a parameter sets a semantic property, try to keep a correlation between the parameter name and the property name. For example, the parameter derivative-of in Template:Page data corresponds to the Property:Derivative of.
- Prefer HTML markup for tables, rather than wikitext - Tables defined with wikitext require pipes, and these pipes often conflict with the pipes of #ifs and other control structures, leading to hacks and unreadable wikitext. Prefer raw HTML markup to avoid these issues (example).
- Learn by example - Visit Category:Templates and learn from existing templates. When in doubt, consult the village pump.
See also
[edit | edit source]- Category:Templates - All templates on Appropedia
- Help:Templates - Guide on how to use templates