Difference between revisions of "Talk:Norway/Media"

From Wikispooks
Jump to navigation Jump to search
(Created page with "Where can I find a template for creating a table? I want to make one over all nationality=Norwegian nationality=Norway and constitutes=editor and constitutes=journalist const...")
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
Where can I find a template for creating a table? I want to make one over all nationality=Norwegian nationality=Norway  and constitutes=editor and constitutes=journalist constitutes=Media owner
 
Where can I find a template for creating a table? I want to make one over all nationality=Norwegian nationality=Norway  and constitutes=editor and constitutes=journalist constitutes=Media owner
 +
[[User:Terje|Terje]] ([[User talk:Terje|talk]])
 +
 +
:THe first place I thought of is [[Template:SMWDocs]], since this includes a whole bunch of tables. There is for example [[Template:Nationals]]. However, these are all using [[Template:SMWDocSection]], so perhaps that is a better place to start. From the code:
 +
<code><nowiki>{{ask
 +
|format=table
 +
|limit={{{limit|}}}
 +
|sort={{{sort|}}}
 +
|order={{{order|}}}
 +
|expression={{{expression|}}}
 +
|mainlabel={{{mainlabel|}}}
 +
|properties={{{properties|}}}
 +
|headers={{{headers|}}}}}
 +
}}</nowiki></code>
 +
This is using [[Template:ask]], which I worked hard on to make flexible enough for most purposes. It has a not very widely used yet syntax of '/' as separators for the {{t|properties}} and  {{t|headers}} fields. The plain vanilla table looks like this:
 +
{{ask
 +
|format=table
 +
|limit=
 +
|sort=
 +
|order=
 +
|expression=[[Constitutes::Editor]][[Has nationality::Norway]]
 +
|mainlabel=Norwegian Editors
 +
|properties=
 +
|headers=
 +
}}
 +
The source code for that table looks like this: <code><nowiki>{{ask
 +
{{ask
 +
|format=table
 +
|limit=
 +
|sort=
 +
|order=
 +
|expression=[[Constitutes::Editor]][[Has nationality::Norway]]
 +
|mainlabel=Norwegian Editors
 +
|properties=
 +
|headers=
 +
}}</nowiki></code>
 +
 +
Note that SMW understands all words as equivalent if they redirect to the same page, so <code><nowiki>[[Has nationality::Norway OR Has nationality::Norwegian]]</nowiki></code> is unneeded. So the first start at the table you're looking for is:
 +
 +
{{ask
 +
|format=table
 +
|limit=
 +
|sort=
 +
|order=
 +
|expression=[[Constitutes::Editor]][[Has nationality::Norway]] OR [[Constitutes::Editor]][[Has nationality::Media mogul]] OR [[Constitutes::Journalist]][[Has nationality::Norway]] OR [[Constitutes::Publisher]][[Has nationality::Norway]]
 +
|mainlabel=Norwegian media players
 +
|properties=
 +
|headers=
 +
}}
 +
This has source: <code><nowiki>{{ask
 +
{{ask
 +
|format=table
 +
|limit=
 +
|sort=
 +
|order=
 +
|expression=[[Constitutes::Editor]][[Has nationality::Norway]] OR [[Constitutes::Editor]][[Has nationality::Media mogul]] OR [[Constitutes::Journalist]][[Has nationality::Norway]] OR [[Constitutes::Publisher]][[Has nationality::Norway]]
 +
|mainlabel=Norwegian media players
 +
|properties=
 +
|headers=
 +
}}</nowiki></code>
 +
 +
The next step is to decide what which columns the table should have, which is expressed as |headers and |properties. These use the '/'-separated list syntax used for <code>|key_properties</code> and <code>|key_property_headers</code>, for example at the "[[Lone nut]]" page.
 +
 +
{{ask
 +
|format=table
 +
|limit=50
 +
|expression=[[Constitutes::Editor]][[Has nationality::Norway]] OR [[Constitutes::Editor]][[Has nationality::Media mogul]] OR [[Constitutes::Journalist]][[Has nationality::Norway]] OR [[Constitutes::Publisher]][[Has nationality::Norway]]
 +
|mainlabel=Norwegian media players
 +
|properties=
 +
|headers=
 +
}}
 +
 +
Hmmmm, that table does not appear to have a 'description' column on the preview. I wonder whether it will if I save it? No. I'll sleep on it. Building such tables has long been the intention of the SMW set up as is, and if it's done properly it shouldn't take much effort, given how hard we've worked to put the data in the database. The wisdom of years asks "which templates would be good to have to build these tables?" [[Template:Media players]?
 +
 +
P.S. I just remembered another page I added tables to: [[Banker/Premature deaths]] . That could be another place to start. -- [[User:Robin|Robin]] ([[User talk:Robin|talk]]) 19:29, 4 July 2023 (UTC)
 +
 +
:Thanks. I tried 10 different table formats without getting any to work!
 
[[User:Terje|Terje]] ([[User talk:Terje|talk]])
 
[[User:Terje|Terje]] ([[User talk:Terje|talk]])

Latest revision as of 06:18, 6 July 2023

Where can I find a template for creating a table? I want to make one over all nationality=Norwegian nationality=Norway and constitutes=editor and constitutes=journalist constitutes=Media owner Terje (talk)

THe first place I thought of is Template:SMWDocs, since this includes a whole bunch of tables. There is for example Template:Nationals. However, these are all using Template:SMWDocSection, so perhaps that is a better place to start. From the code:

{{ask |format=table |limit={{{limit|}}} |sort={{{sort|}}} |order={{{order|}}} |expression={{{expression|}}} |mainlabel={{{mainlabel|}}} |properties={{{properties|}}} |headers={{{headers|}}}}} }} This is using Template:ask, which I worked hard on to make flexible enough for most purposes. It has a not very widely used yet syntax of '/' as separators for the properties and headers fields. The plain vanilla table looks like this:

Norwegian Editors
Kjetil Alstadheim
Trine Eilertsen
Torolf Elster
Thor Gjermund Eriksen
Einar Førde
Rolf Gerhardsen
Per Egil Hegge
Helge Seip
Hanne Skartveit
Nils Udgaard
Hans Vatne
Dagfinn Vårvik

The source code for that table looks like this: {{ask {{ask |format=table |limit= |sort= |order= |expression=[[Constitutes::Editor]][[Has nationality::Norway]] |mainlabel=Norwegian Editors |properties= |headers= }}

Note that SMW understands all words as equivalent if they redirect to the same page, so [[Has nationality::Norway OR Has nationality::Norwegian]] is unneeded. So the first start at the table you're looking for is:


Norwegian media players
Kjetil Alstadheim
Trine Eilertsen
Torolf Elster
Hans Engen
Thor Gjermund Eriksen
Einar Førde
Rolf Gerhardsen
Per Egil Hegge
Christian Michelsen
Finn Moe
Helge Seip
Hanne Skartveit
Pål Steigan
Arne Treholt
Nils Udgaard
Hans Vatne
Dagfinn Vårvik

This has source: {{ask {{ask |format=table |limit= |sort= |order= |expression=[[Constitutes::Editor]][[Has nationality::Norway]] OR [[Constitutes::Editor]][[Has nationality::Media mogul]] OR [[Constitutes::Journalist]][[Has nationality::Norway]] OR [[Constitutes::Publisher]][[Has nationality::Norway]] |mainlabel=Norwegian media players |properties= |headers= }}

The next step is to decide what which columns the table should have, which is expressed as |headers and |properties. These use the '/'-separated list syntax used for |key_properties and |key_property_headers, for example at the "Lone nut" page.


Norwegian media players
Kjetil Alstadheim
Trine Eilertsen
Torolf Elster
Hans Engen
Thor Gjermund Eriksen
Einar Førde
Rolf Gerhardsen
Per Egil Hegge
Christian Michelsen
Finn Moe
Helge Seip
Hanne Skartveit
Pål Steigan
Arne Treholt
Nils Udgaard
Hans Vatne
Dagfinn Vårvik

Hmmmm, that table does not appear to have a 'description' column on the preview. I wonder whether it will if I save it? No. I'll sleep on it. Building such tables has long been the intention of the SMW set up as is, and if it's done properly it shouldn't take much effort, given how hard we've worked to put the data in the database. The wisdom of years asks "which templates would be good to have to build these tables?" [[Template:Media players]?

P.S. I just remembered another page I added tables to: Banker/Premature deaths . That could be another place to start. -- Robin (talk) 19:29, 4 July 2023 (UTC)

Thanks. I tried 10 different table formats without getting any to work!

Terje (talk)