Useful templates

From ZDoom Wiki
Jump to navigation Jump to search

Want to help the wiki? Want to improve or create an article? Well then, keep in mind that there are several tools at your disposal to make everyone's job simpler. MediaWiki (the wiki engine used here) uses templates, which allow to insert preformated code. They can be extremely powerful when used correctly, because they allow to use parameters and conditional expressions.

Here are some templates that are simple to use:

  • Template:Forum for ZDoom.org forum links. A forum thread URL looks like this: http://forum.zdoom.org/viewtopic.php?f=1&t=2345. Simply copy the "t=number" part in your forum template like this: {{forum|t=2345}}. You can give a title to the link by making it the first parameter: {{forum|Click me|t=2345}}.
  • Template:Class for linking to actor classes. All actor classes have an article, but with Classes: prefixed which makes them a bit cumbersome. A link to DoomImp will either require you to type [[Classes:DoomImp|DoomImp]] or will contain this extraneous Classes: in its title. With the {{Class}} template, you can just type {{Class|DoomImp}}.
  • Template:Flag and Template:Property: You can link directly to an actor flag or an actor property by using these templates. Given the size of the actor flags and actor properties page, this is more practical for the wiki reader.
  • Template:Const and Template:SType for ACS code samples, You can display a defined constant easily, and have it display its value upon mouseover like this: {{const|PLAYER_TID|200}}. The different script types such as ENTER or OPEN can be templated with this code: {{SType|enter}}.
  • Template:LE to give an anchor to a list element. This is what the aforementioned flag and property templates rely on. Simply put this template around a word, and this word will be turned into an anchor. For example, if you put {{LE|bar}} in the Foo article, then [[Foo#bar]] will link directly to that word. Keep in mind that capitalization is important for this to work, as specified by HTML norms: in the previous example, [[Foo#Bar]] wouldn't work because you didn't use {{LE|Bar}}. To offset that, you can specify up to two additional names; only the first will be shown in the article but all could be used in links. For example, {{LE|bar|Bar|helloworld}}.
  • Template:New: A feature marked {{new}} is present in the latest release, but not yet added to child ports. See the template page for more information.
  • Template:Git: Marks a feature that has been added in a new development version since the latest release. A revision number is included like this: {{git|61c9464}}. See the template page for more information.