Blue-exclamation-mark

This tutorial is designed for use with Source Editor.

Source Editor is the official editor for Wookieepedia. To switch to Source Editor, go to the editing tab in your preferences.

This page collects tutorials for advanced editing tasks, such as creating new citation templates.


How to Build: Templates

Magazine, comics and similar citation templates

For magazines, comics, and other media that are collections of stories or articles in each issue, we use citation templates that, in general, take two or three parameters—an issue parameter, a story/article parameter, and optionally a formatting parameter for when the story or article's title is italicized. These are typically unnamed, such as {{InsiderCite|115}}. This tutorial will walk you through the creation of a new citation template of this type.

Start with the basics:

<includeonly>{{#invoke:BaseCitation|main
|template=Name of your template without the Template: prefix
|mode=magazine
|series=Name of the magazine/comic series, without any parentheticals
|issue={{{1|}}}
|issue1={{{issue1|}}}
|issue2={{{issue2|}}}
|child={{#if:{{{issue1|}}}|{{{1|}}}|{{{2|}}}}}
|ctext={{#if:{{{issue1|}}}|{{{2|}}}|{{{3|}}}}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>

This template, like the majority of our templates, will use the BaseCitation module, a custom template builder that supports a lot of different options. A number of these fields are already filled out:

  • mode — This is a shorthand way to set the ordering & spacing of the various parts of your template, and takes several options:
    • "magazine" means that the template will wrap the article/story parameter in quotes and list it before the issue, separating them with an emdash.
    • "ref" is for reference magazines, and tells the builder to list the issue first, and to wrap the article in {{C}}, as well as some fancy text lookup.
    • "tv" will be covered in the next tutorial.
  • issue, issue1 and issue2 — These parameters are used to build the link to the specific issue you want to cite. Some magazine articles or comic stories are spread out across multiple issues, so the issue1 and issue2 parameters are used in such cases.
  • child — the magazine article or comic story that you're citing. It is usually the second parameter, except when issue1 & issue2 are provided, hence the if statement.
  • ctext — the formatted title of the magazine article or comic story. Note that the template builder will automatically remove any parenthetical descriptors from the final text, so you won't need to populate this parameter when using your template unless it has special italicization or other title formatting.

Now, consider the following questions, and add each line if the answer is yes.

  • Does your template need an image?
    |image=[[File:YourFilename.jpg|x16px|link=Link to the series]]
  • Is the series title not italicized at all?
    |noitalics=1
  • Does the series have special italicization or formatting, like Star Wars Battle Games?
    |stext=special formatting
  • Did the series name change at one point, like The Lucasfilm Fan Club Magazine becoming Star Wars Insider with issue 23?
    |series2=the prior name of the series
    |stext2=special formatting for series2 if necessary
    |threshold=the issue # that the series name changed
  • Do our articles on each issue have a suffix or parenthetical descriptor, like Star Wars: Darth Vader (magazine)?
    |suffix=(magazine)
  • Do you want to display the suffix as part of the issue title, like The Official Star Wars Fact File Part 1 (2014)?
    |suffix=(2014)
    |showsuffix=1
  • Does the suffix only apply to the first few issues, like the first five issues of the 2014 Fact File?
    |suffix2=(2014)
    |showsuffix=1
    |threshold=the issue # that the series name changed
  • Do you want to be able to remove the quotation marks around the article or story?
    |noquotes={{{noquotes|}}} (case by case) or |noquotes=1 (all usages)
  • Are there cases where we don't want the article or story to link to a Wookieepedia article?
    |nolink={{{nolink|}}}
  • Have any of the articles or stories been reprinted in other material, and you need the template to support {{Reprint}}?
    |reprint=1


Other:

  • |invert=1
    |nospaces=1
    |ndash=1
    |parentfirst=1

Television and other non-Internet citation templates

Internet citation templates

Start with the basics:

<nowiki><includeonly>{{#invoke:InternetCitation|main
|template=Name of your template without the Template: prefix
|site_text=[[Company Name]]'s [http://yourwebsite.com official website]
|full_url=https://{{{subdomain|www}}}.yourwebsite.com/{{{url|}}}
|target_url={{{url|}}}
[Additional Template Parameter Go Here]
}}</includeonly><noinclude>{{Documentation}}</noinclude>

Now, consider the following questions, and add each line if the answer is yes.

  • Does your template need an image?
    |image=[[File:YourFilename.jpg|x16px|link=Link to the website homepage]]
  • Will we have articles for individual pages on this website, and will you want to link to them in the citation template?
    |int={{{int|}}}
  • Do you want the site name to be listed before the webpage name? i.e. "<Site Text> <Webpage>"
    |site_first=1
  • Do you want the template to separate the webpage & site name with something other than "on"? i.e. "<Webpage> at <Site Text>"
    |separator=your custom separator
  • Is the website no longer available, such as Wizards.com or the original StarWars.com?
    |defunct_site=1 (sets the "nolive" parameter to true for all usages of the template and displays "original site is defunct")
  • Is your website a social media site?
    |citation_type=Social media citations
  • Will your template have a Module:ArchiveAccess subpage?
    Yes — |use_lua_subpage=1
    No — |no_archive=1
  • Are there cases where you'll need to give a full URL in the template, and not just part of it?
    Wrap your "full_url" value in your template with {{{full_url| and }}}
    |is_full_url=1 (prevents these from being flagged as invalid values)

The following are edge cases that should only be added after consultation with other editors:

  • Will your template allow for unnamed parameters? (only permitted for certain scenarios, such as the Databank templates)
    |allow_unnamed=1
  • Does your template use a field name other than "text" for the name of the webpage, or is it unnamed?
    |text={{{custom parameter name|}}}
  • Is your site completely inaccessible, and thus a backup does not exist for every page?
    |backup_optional=1 (sets the "nobackup" parameter to true if a backup is not provided, so the "nobackup" parameter isn't need on every usage)

Some other things to know:

  • You do not have to manually define the {{ArchiveAccess}} parameters (archivedate, archivefile, etc.) in the template code itself; the Lua module will read in those parameters from any usages on articles.
  • The same holds true for parameters such as date, time, text, author, lang, and quote.
  • If the "lang" or domain parameters are given, the module will attempt to derive the corresponding language name, and will automatically add that into your site text if it includes "official website".