Modul:Sandkasse/Poul G/Dataliste/dok

Fra Wikipedia, den frie encyklopædi

Datalist is a module intended to support presentation ordered sequences (lists) of different dataitems.

The presentation can take three forms:

  1. infobox - the boxes normally found at the right side of the top of an article with key facts about the subject.
  2. section - a section presented in the article. This section will be more fact centered and less prose-like than other sections. Eg an article about an engine could have a secion covering specifications such as dimension, volume, performance etc.
  3. table - a tabular form, where the data of the subject of the article is comparet to relevant other subjects. TODO

Datalist is ment to be "wrapped" in a template, where the template controls the behaviour of Datalist.

The data presented can originate from Wikidata properties (property) or from parameters supplied from the calling page (data).

Parameters[rediger kildetekst]

Parameters Explanation Example
Headlines above it all
title titleclass titlestyle Specifies the title to appear before the datalist. For infobox it will appear above the table. For setion it will generate a heading (==title==) for the section. title=Engine
above aboveclass abovestyle Specifies something to appear before the datalist, but after the title. For infobox it will generate a heading inside the box. For section it will generate normal text in the beginning of the section.
Value-lines # denotes numerically indexed parameters; they will be presented in their numerical order. [#] denotes parameters, which can be indexed or specified as a default value for all instances. If the same index are used for multiple purposes, the priority will be header, image & itemformatter/data/property.
header# headerclass[#] headerstyle[#] Specifies a headline to appear above a subsection. Intended for use, when many values might clutter the view. header10=Developement and intro
image# imageclass[#] imagestyle[#] Specifies an image to be displayed at the given position. The specification should include with and could include caption and alt-text. Images specified in Wikidata can not be included this way; use the data-parameter instead. image20=[[File:Harley-Davidson-WL.jpg|200px|Harley-Davidson 1947]]
label# labelclass[#] labelstyle[#] Specifies the label to appear before the value. If no label is given, and a wikidata-property is specified, the wikidata-label will be used. label30=Designer
data# Specifies the name of the field to search for a value from the calling page. data30=designer

and in the item-page: designer=Davidson

property# link[#] rank[#] propertyformatter# Specifies the property (attribute) to retrive from wikidata. Formatting of the value is delegated to Module:Wikidatas formatStatementsFromLua. If link, rank or (property-) formatter are specified, they are feed to Wikidata.formatStatementsFromLua. property40=P22
itemformatter# Specifies a formatter to generate a value based on the complete item. The format is Module.function. Intended for use, when more than one attribute is needed. The value vil override values found by property. itemformatter50=Wikidata.lifespan
priority[#] As per. default, specified values (data) and takes precedence over values found in wikidata (property/itemformatter). Priority can be given to wikidata with this parameter. priority=wikidata
Tail
below belowclass belowstyle Specifies something to appear below the datalist. For infobox it will generate some centered text at the bottom of the box. For section it will generate normal text in the end of the section.
Shared
item[#] Specifies the wikidata-item to fetch data from. Default the item linked to the displayed page will be used. Must be specified for item2++ in table. item2=Q42


More Comprehensive Examples[rediger kildetekst]

Infobox[rediger kildetekst]

Lua-fejl i Modul:Sandkasse/Poul_G/Dataliste på linje 107: attempt to concatenate local 'propValue' (a nil value).

{{#invoke:Sandkasse/Poul G/Dataliste|infobox
 | item = Q544661
 | above = Svævefly<br/>Rolladen-Schneider LS4
 | abovestyle = background: #87CEEB; font-size: larger;
 | link = local
 | rank = valid
 | image10 = [[file:Ls-4.JPG|300px|... caption ...]]
 | label20 = Class               | property20 = P279
 | label30 = Country             | property30 = p17         | propertyformatter30 = iconItem
 | label40 = Manufacturer        | property40 = p176
 | label50 = Series length       | property50 = p1092
 | label51 = i DK                | data51 = antalDK         | antalDK = Ca. 30
 | label60 = Designer            | property60 = p287
 | label70 = First flight        | property70 = p606
 | label90 = Handicap            | data90 = handicap        | handicap = 103.8 (EGU)
 | below = Demonstration only
}}

Section[rediger kildetekst]

Lua-fejl i Modul:Math på linje 517: attempt to call field '?' (a nil value).

Table[rediger kildetekst]

TBS