Difference between revisions of "Template:MakeRef"

From Wikispooks
Jump to navigation Jump to search
(Created page with "<noinclude>Category:Templates'''This is used by Template:SMWQ. It makes a reference out of the following params, each of which is optional:'''<br/> * source_name * sou...")
 
m (Trim junk)
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>[[Category:Templates]]'''This is used by [[Template:SMWQ]]. It makes a reference out of the following params, each of which is optional:'''<br/>
+
<noinclude>[[Category:Templates]]'''This is used by [[Template:SMWQ]]. It uses [[Template:MakeRef/Name]]. It makes a reference out of the following params, at least one of which is required:'''<br/>
* source_name
+
* {{t|ref_name}} (only useful if the page featured multiple references from this source)
* source_URL (recommended!)
+
* {{t|source_name}} (recommended) - If this is a page name, it will link to that page
* source_details</noinclude><includeonly>{{#if: {{{source_URL|}}}{{{source_name|}}}{{{source_details|}}}<ref>{{#if: {{{source_URL|}}}|{{#if: {{{source_name|}}}|[{{{source_URL|}}} {{{source_name}}}]|{{{source_name|}}} {{{source_details|}}}</ref>}}</includeonly>
+
* {{t|source_URL}} (recommended)
 +
* {{t|source_title}} (recommended) - Title of the document
 +
* {{t|source_details}} (optional) - Use for extra details, e.g. p.95</noinclude><includeonly><!--
 +
 
 +
Some or all of source_*:
 +
    Make a unique ref, and name it "ref_name" if that param is also given
 +
 
 +
--> {{#if: {{{source_URL|}}}{{{source_URL|}}}{{{source_name|}}}{{{source_details|}}}{{{source_title|}}}|{{#tag:ref|{{#if: {{{source_URL|}}}|{{#if: {{{source_title|}}}|[{{{source_URL|}}} {{{source_title|}}}] |{{{source_URL|}}}}}|}} {{LinkIfExists|{{{source_name|}}}}} {{{source_details|}}}|name={{MakeRef/Name|ref_name={{{ref_name|}}}|source_name={{{source_name|}}}|source_URL={{{source_URL|}}}|source_details={{{source_details|}}}}}}}|<!--
 +
 
 +
-->{{#if: {{{ref_name|}}}|<!--
 +
 
 +
ref_name :
 +
    Use an existing ref
 +
 
 +
-->{{#tag:ref||name={{{ref_name|}}}}}|<!--
 +
 
 +
No params:
 +
    {{CN}}
 +
 
 +
-->{{cn}}}}}}</includeonly>

Latest revision as of 16:04, 25 March 2019

This is used by Template:SMWQ. It uses Template:MakeRef/Name. It makes a reference out of the following params, at least one of which is required:

  • ref_name (only useful if the page featured multiple references from this source)
  • source_name (recommended) - If this is a page name, it will link to that page
  • source_URL (recommended)
  • source_title (recommended) - Title of the document
  • source_details (optional) - Use for extra details, e.g. p.95