Template:Item: Difference between revisions

From Discourse DB
Jump to navigation Jump to search
(Briefly testing source field as well)
(Added escaping of quotes in query)
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>This template holds information on an opinion item (a column, op-ed, blog post, etc.); it should be called with the following structure:
<noinclude>This template holds information on an opinion item (a column, op-ed, blog post, etc.). It should be called in the following format:
<pre>{{source
<pre>
|author=The author of the item; if there is more than one, just enter the first one (the "Additional author" template is used for the others)
{{Item
|author=The author or authors of the item; if there is more than one, their names should be separated with commas
|source=The publication in which it was printed/posted
|source=The publication in which it was printed/posted
|date=The date of publication
|date=The date of publication
Line 7: Line 8:
|quote=A one-to-four-sentence quote from the item, that captures the spirit of the opinion it holds
|quote=A one-to-four-sentence quote from the item, that captures the spirit of the opinion it holds
}}
}}
</pre>
</pre> {{#cargo_declare:_table=Items|Author=List (,) of Page|Source=Page|Date=Date|URL=URL|Quote=Text|Summary=Wikitext (size=600)}}
The order of the fields is not relevant.
</noinclude><includeonly>
</noinclude><includeonly>
This is an opinion item. [[title::{{PAGENAME}}| ]]
This is an opinion item. {{#cargo_store:_table=Items|Author={{{author|}}}|Source={{{source|}}}|Date={{{date|}}}|URL={{{url|}}}|Quote={{{quote|}}}|Summary=[[{{PAGENAME}}]] by {{#arraymap:{{{author|}}}|,|x|[[x]]}} (''[[{{{source|}}}]]'', {{{date|}}}) ([{{{url|}}} view])}}


{| border="0" cellpadding="4" cellspacing="4" style="margin-bottom: 5px;"
{| border="0" cellpadding="4" cellspacing="4" style="margin-bottom: 5px;"
! Author
! Author(s)
| {{#arraymap:{{{author}}}|,|x|[[Was written by::x]]}}
| {{#arraymap:{{{author|}}}|,|x|{{#formredlink:target=x|form=Author|alt_form[0]=Editorial board}}}}
|-
|-
! Source
! Source
| {{#arraymap:{{{source}}}|,|x|[[Was published by::x]]}}
| {{#formredlink:target={{{source|}}}|alt_form[0]=Source|alt_form[1]=Magazine|alt_form[2]=Online magazine}}
|-
|-
! Date
! Date
| [[Was published on:={{{date|unknown}}}]]
| {{{date|}}}
|-
|-
! URL
! URL
| [[Has URL:={{{url|unknown}}}]]
| {{{url|}}}
|-
|-
! Quote
! Quote
| <div style="background: #fafaea; padding: 10px; border: 1px solid #cccccc;">[[Has quote:={{{quote|unknown}}}]]</div>
|
{| style="background: #fafaea; padding: 10px; border: 1px solid #cccccc;"
| style="vertical-align: top;" | [[File:Quotes-start.png]]
| style="padding: 0 10px 0 10px;" | {{{quote|}}}
| style="vertical-align: bottom;" | [[Image:Quotes-end.png]]
|}
|}
|}
{{#cargo_query:table=Item_references|where=Previous_item="{{#replace:{{PAGENAME}}|&#34;|\"}}"|intro=The following other items refer to this item:&nbsp;|default=}}


<ask intro="The following other items refer to this item: ">[[Refers to::{{PAGENAME}}]]</ask>
<p><small>[[Special:FormEdit/Item references/{{PAGENAME}}|Add or change this opinion item's references]]</small></p>
<p><small>[http://discoursedb.org/wiki/Special:EditData/Item_references/{{PAGENAMEE}} Add or change this opinion item's references]</small></p>
[[Category:Items]]
[[Category:Items]]
</includeonly>
</includeonly>

Latest revision as of 20:19, February 3, 2016

This template holds information on an opinion item (a column, op-ed, blog post, etc.). It should be called in the following format:

{{Item
|author=The author or authors of the item; if there is more than one, their names should be separated with commas
|source=The publication in which it was printed/posted
|date=The date of publication
|url=A URL at which it can be found, if one exists
|quote=A one-to-four-sentence quote from the item, that captures the spirit of the opinion it holds
}}

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