Community Central
Community Central

Many communities use quote templates to highlight notable snippets of text such as lyrics, book passages, spoken phrases, or extracts from interviews or news articles. These templates can contain quotes from a single source, dialogues, etc.

Template creation[]

Template:StructuredQuote is the template that will be used by default. This template will be created by Fandom, and will respect any previous version created by the community. It can be renamed, but it will work only if there is a redirection from the original name.

Wikitext is working in this template, just like any other template. The next code can be used to create a simple version of this template with all the parameters that will be stored:

:"''{{{text}}}''"
:— <small>speaker: {{{speaker}}}
:- receiver: {{{receiver}}}
:- attribution {{{attribution}}}
:- source: {{{source}}}</small>
:- author: {{{author}}}</small>

Structured Quotes always present their output as a regular template does. This means there’s no implicit text block created.

Using different output templates[]

Template:StructuredQuote is the default template that is used by {{#SQuote:...}}. It is however possible to format the output using a different template, by using the template parameter when a new quote is created, you are querying multiple quotes or you are invoking a quote created in a different article.

The template name must be given in the syntax as plain text, i.e. Example template and not [[Template:Example template]] or {{Example template}}.

Design customizations[]

As with any other template, it is possible to customize the design of the templates using wikitext, HTML, JavaScript, Lua, CSS, TemplateStyles, and inline styles. Please check our customization policy to learn more details about what can be customized on our platform.

Samples[]

Simple design
Size matters not. Look at me. Judge me by my size, do you? Hmm? Hmm. And well you should not. (...)

Yoda, to Luke Skywalker, Star Wars: Episode V The Empire Strikes Back


More complex design
Yoda SWSB
Size matters not. Look at me. Judge me by my size, do you? Hmm? Hmm. And well you should not. (...)


Quotes[]

Although the template has the same behavior as a regular template, the markup for invoking the template into the articles differs. Assuming you are using the default parameters used in the example above, you will have to use the next syntax for using the template in the articles:

{{#SQuote:
|id=<unique identifier>
|text=<quote text>
|speaker=<individual(s) who uttered or wrote the quoted words (wikitext links, comma-separated)>
|receiver=<person the quote was spoken to (wikitext links, comma-separated)>
|attribution=<attribution (wikitext links, comma-separated)>
|source=<place where it was spoken (wikitext link)>
|author=<author (wikitext links, comma-separated)>
|template=<name of the custom template without a namespace (optional, by default it's using "StructuredQuote")>
}}

It isn't possible to use the template in the articles using {{StructuredQuote|id=....}}, it won't render the template correctly and the structured quote won't be stored in our database. It only works with the previous markup. It means all the previously created quotes using templates without the previous markup will have to be converted with a unique ID to work as structured content.

The unique ID can be a number, a word, or a combination of both. - and _ are also allowed. IDs are case-sensitive, and you will see a warning if a previous ID is used in a new quote. The ID cannot contain spaces.

This syntax will be automatically loaded in the source editor after clicking the Structured Quote icon in the toolbar:

Structured Quote Icon in Source Editor toolbar

Reusing an existing quote[]

One of the main advantages of Structured Quotes is the possibility of querying quotes from the articles without updating the page every time a new quote is added to the wiki. For using a quote in different articles, you will only have to use the original ID and the syntax {{#SQuoteGet:id=...}}

For example:

{{#SQuoteGet:
|id=testquote
|template=StructuredQuote2
}}

Being the template parameter optional depending on which template should be used for rendering the quote.

Querying[]

In the case you want to list multiple quotes instead of a single one, there is a special parser function that will allow you to list them using specific criteria: #SQuoteQuery.

{{#SQuoteQuery:
|limit=<number of quotes to show>
|speaker=<individual(s) who uttered or wrote the quoted words (wikitext links, comma-separated)>
|receiver=<person the quote was spoken to (wikitext links, comma-separated)>
|attribution=<attribution (wikitext links, comma-separated)>
|source=<place where it was spoken (wikitext link)>
|author=<author (wikitext links, comma-separated)>
|template=<name of the custom template without a namespace (optional, by default it's using "StructuredQuote")>
}}

This will allow you to add multiple quotes in an article without having to manually add them, and the content of those quotes will be updated when the original quote is changed.

It isn't possible to filter quotes by IDs or using exclusions, for example: list quotes done by X character with the ID starting by "Yoda" and remove quotes received by "Mace Windu".

The quotes will by default appear using Template:StructuredQuote. It is possible to present the quotes using another template using the template parameter described above.

Some considerations[]

Like other templates, you can add different parameters, use wikitext, add images, use HTML markup, parser functions, magic words, et cetera. But there are some rules that you have to remember:

  1. The default quote template created by Fandom is called "Template:StructuredQuote", but it can be renamed and will work so long as there is a redirect left at the original template.
    • It is possible to use other templates for the quotes by indicating it with the parameter template.
  2. It won't create structured data if the template is invoked using the regular markup {{StructuredQuote}}. This template has its own syntax.
  3. Every quote on a given wiki must have a unique ID.
    • IDs can use numbers, letters, hyphens, and underscores.
    • IDs are case-sensitive.
    • If you give a quote an ID that has already been used, it will produce an error and prevent you from saving the edit.
    • Changing the ID of a quote will break all instances where that quote is used in other articles via SQuoteGet.
  4. Multiple links can be added to the parameters (for example, more than one character can be attributed to the quote), but this template isn't optimized to include dialogue.
  5. Although you can add more parameters, only id, text, speaker, receiver, attribution, source, and author will be stored in the database.
  6. The parameters speaker, receiver, attribution, source, and author can contain external and internal links, and you can link to non-created pages.

Further help and feedback[]