Template:Author: Difference between revisions

From Discourse DB
Jump to navigation Jump to search
(The official starting version)
 
(Text => String)
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>
<noinclude>This template holds information on an author of opinion items; it should be called with the following structure:
This is an [[is of type::Type:Author|author]].
<pre>{{Author
[[first name:={{{first name}}}| ]] [[last name:={{{last name}}}| ]]
|first name=The author's first name; used for sorting
Political Affiliation: [[political affiliation:: {{{political affiliation|unknown}}} ]]
|last name=The author's last name; used for sorting
|political affiliation=Liberal, Conservative, etc. (This is a very subjective field)
}}
</pre>
{{#cargo_declare:_table=Authors|First_name=String (hidden)|Last_name=String (hidden)|Political_affiliation=String}}
</noinclude><includeonly>{{#cargo_store:_table=Authors|First_name={{{first name|}}}|Last_name={{{last name|}}}|Political_affiliation={{{political affiliation|}}} }}
This is an [[:Category:Authors|author]].
 
Political affiliation: {{{political affiliation|}}}


Items by this author:
Items by this author:
<ask format="ul"> [[Was written by::{{PAGENAME}}]][[addresses topic::*]] </ask>
{{#cargo_query:tables=Items, Opinions
[[Category:Authors|{{#if:{{{last name|}}}|{{{last name}}}, {{{first name|}}}|{{PAGENAME}}}}]]
|join on=Items._pageName=Opinions._pageName
|where=Author HOLDS "{{PAGENAME}}"
|fields=Items._pageName,Topic,Position_link=Position,Stance
|format=ul
}}
 
[[Category:Authors]]
{{DEFAULTSORT:{{#if:{{{last name|}}}|{{{last name}}}, {{{first name|}}}|{{PAGENAME}}}}}}
</includeonly>
</includeonly>

Revision as of 17:51, November 6, 2015

This template holds information on an author of opinion items; it should be called with the following structure:

{{Author
|first name=The author's first name; used for sorting
|last name=The author's last name; used for sorting
|political affiliation=Liberal, Conservative, etc. (This is a very subjective field)
}}

This template defines the table "Authors". View table.