Difference between revisions of "Template:Topic"

From Discourse DB
Jump to navigation Jump to search
(Resaving)
(Changed most of the queries)
Line 15: Line 15:
 
Its theme(s) are {{#arraymap:{{{Themes|}}}|,|x|[[Has theme::x]]}}.
 
Its theme(s) are {{#arraymap:{{{Themes|}}}|,|x|[[Has theme::x]]}}.
  
{{#ask:[[Category:Positions]][[Addresses topic::{{PAGENAME}}]]|format=topiclayout}}
+
==Summary of positions for this topic==
 +
{{#cargo_query:tables=Items,Opinions
 +
|join on=Items._pageName=Opinions._pageName
 +
|fields=concat(Opinions.Position_link, ' (', count(*), ' items)')
 +
|group by=Opinions.Position
 +
|where=Opinions.Topic="{{PAGENAME}}"
 +
|order by=Items.Date
 +
|format=ul
 +
}}
  
<font size="+1">All items that address this topic ([[Has number of opinion items::{{#ask:[[Category:Items]][[Addresses topic::{{PAGENAME}}]]|format=count}}]] total)</font>
+
==Full listing==
<hr>
+
''Click on position names to view quotes from each listed item.''
{{#ask:[[Category:Items]][[Addresses topic::{{PAGENAME}}]]|mainlabel=Title|sort=Was published on|order="descending"|? Was written by=Author|? Was published by=Source|? Was published on=Date}}
+
 
 +
{{#cargo_query:tables=Items,Opinions
 +
|join on=Items._pageName=Opinions._pageName
 +
|fields=Items.Summary,Opinions.Position_link,Opinions.Stance
 +
|where=Opinions.Topic="{{PAGENAME}}"
 +
|format=ddb outline
 +
|outline fields=Position_link,Stance
 +
|order by=CASE Stance
 +
        WHEN 'for' THEN 1
 +
        WHEN 'against' THEN 2
 +
        WHEN 'mixed' THEN 3
 +
        END, Date DESC
 +
}}
 +
 
 +
==All items that address this topic ({{#cargo_query:tables=Items,Opinions
 +
|join on=Items._pageName=Opinions._pageName
 +
|fields=count(DISTINCT Items._pageName)
 +
|where=Opinions.Topic="{{PAGENAME}}"
 +
}} total)==
 +
 
 +
{{#cargo_query:tables=Items,Opinions
 +
|join on=Items._pageName=Opinions._pageName
 +
|fields=Items._pageName=Title,Items.Author,Items.Source,Items.Date
 +
|where=Opinions.Topic="{{PAGENAME}}"
 +
|order by=Items.Date
 +
|group by=Items._pageName
 +
}}
  
 
{{#ask:[[Category:Items]][[Addresses topic::{{PAGENAME}}]]|? Was written by=Author|? Was published by=Source|? Was published on=Date|format=timeline|timelinebands=DAY,MONTH|timelineposition=end|timelinesize=400px}}
 
{{#ask:[[Category:Items]][[Addresses topic::{{PAGENAME}}]]|? Was written by=Author|? Was published by=Source|? Was published on=Date|format=timeline|timelinebands=DAY,MONTH|timelineposition=end|timelinesize=400px}}
 
[[Category:Topics]]
 
[[Category:Topics]]
 
</includeonly>
 
</includeonly>

Revision as of 17:13, November 13, 2014

This template holds information on a political topic. It should be called in the following format:

{{Topic
|Start date=The date at which the topic started, if there was one
|End date=The date at which the topic ended, if there was one
|Themes=The theme(s) of this topic, separated by commas if there's more than one
}}

An example of start and end date would be, if the topic is a bill, the date the bill was introduced in Congress, and the date it was signed into law, respectively.

The order of the fields is not relevant.