Difference between revisions of "Template:Url ref"

m
Tweak ref naming
m (added example and clarification. Is there a template that produces code blocks like <pre> without putting each one on its own line?)
m (Tweak ref naming)
 
(3 intermediate revisions by 2 users not shown)
-->{{{post|}}}<!-- -->{{#if:{{{post|}}}|{{ref/uses-post}}|}}<!--
 
--><br><small> &mdash; {{{site}}} {{#if:{{{date|}}}|- {{{date}}}|}}<sup><hash-text link="#">{{{url}}}</hash-text></sup></small><!--
 
--><span class="cm-tracking"><hash-text link="#">{{{url}}}</hash-text></span><!--
 
NAME
-->|name={{{name|{{{site}}}-{{{date|{{{text}}}|}}}|}}}<!--
 
GROUP
This template is used to refer to URLs. This allows us to track where raw URLs are used, so we can keep them up to date easily.
 
To use, include {{t|url ref|url&#61;<nowiki>httphttps://...</nowiki>|text&#61;|site&#61;}}
* {{{url}}} and {{{text}}} are the link and link-text
* {{{site}}} indicates which website the page is on
* {{{date}}} is the publication date (yyyy-mm-dd)
* {{{group}}} sets the reference group
 
For example, <code><nowiki>{{url ref|url=http://inkthinker.deviantart.com/art/The-Way-of-Kings-Skyeels-180124400|text=Skyeel Illustration Description|site=[[Inkthinker]]'s DeviantArt}}</nowiki></code>, which produces the following in the references list:{{url ref|name=luckspren|url=http://inkthinker.deviantart.com/art/The-Way-of-Kings-Skyeels-180124400|text=Skyeel Illustration Description|site=[[Inkthinker]]'s DeviantArt}}
for example:
<references />
<pre> {{url ref|name=luckspren|url=http://inkthinker.deviantart.com/art/The-Way-of-Kings-Skyeels-180124400|text=Skyeel Illustration Description|site=[[Inkthinker]]'s DeviantArt}}</pre>
which produces:{{url ref|name=luckspren|url=http://inkthinker.deviantart.com/art/The-Way-of-Kings-Skyeels-180124400|text=Skyeel Illustration Description|site=[[Inkthinker]]'s DeviantArt}}
<references/>
 
 
Because this reference template often requires a large amount of text, it's better to replace <code><nowiki><references /></nowiki></code> with
If you are referencing the same URL multiple times on one page you '''must''' use <pre>{{url ref|name}}</pre> (where "name" is the name you defined in the template) every time it is referenced in the text and put the full template at the bottom of the article between <pre><references></pre> and <pre></references></pre>
 
<pre><references>
In our example, if you referenced that URL multiple times on the page you would put <pre>{{url ref|luckspren}}</pre> every time it is referenced and put <pre><references>
 
{{url ref|name=luckspren|url=http://inkthinker.deviantart.com/art/The-Way-of-Kings-Skyeels-180124400|text=Skyeel Illustration Description|site=[[Inkthinker]]'s DeviantArt}}
</references></pre>
 
on the bottom of the page.
and then place all url references between the <code><nowiki><references></nowiki></code> and <code><nowiki></references></nowiki></code> tags. When you do this, you should add <code>|name=''name''</code> to the url reference, where ''name'' is a unique identifier for the reference. Then, you will be able to cite this reference in the body of the article with {{t|ref|name&#61;''name''}}. If you are citing the same url reference multiple times, you must use this method; otherwise it will result in a reference error because the template tries to create two references with the same name.
 
[[Category: Sources]]
Technically, you could place the named url reference somewhere in the body of the article and then use {{t|ref}} to cite that reference elsewhere in the article. Most of the time, however, it's simpler and more elegant to just put the named url ref between the references tags and use {{t|ref}} everywhere in the article.
 
[[Category: Reference templates]]