Difference between revisions of "Template:Timeline"

From Wikispooks
Jump to navigation Jump to search
(link strip on top)
m (Text replacement - "__NOCACHE__" to "")
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{template
+
<noinclude>{{WStemplate
 
|categories=Object Templates
 
|categories=Object Templates
 
|summary=This template is for timelines.
 
|summary=This template is for timelines.
Line 8: Line 8:
 
<poem>
 
<poem>
 
{{Timeline
 
{{Timeline
''Required parameter:''
+
''Required parameters:''
|position     =When the timeline is centered
+
|{{NAVY|timelineposition}}     =When the timeline is centered
''All other parameters are optional.''
+
''Recommended parameters:''
|image        =Image to show in the sidebox
+
|{{NAVY|timelinestart}}        =The earliest point on the timeline
|category      =Name of the unique category and form (deprecated)
+
|{{NAVY|timelineend}}          =The latest point on the timeline
|events        =Name of the unique category and form (deprecated)
+
''OPTIONAL SUBSECTIONS:''
|key_events    =Name of important events, which provide the images at the top
+
|expression                = semantic web query to choose items. Defaults to "<nowiki>[[Display at::{{FULLPAGENAME}}]]</nowiki>"
 +
|timelinebands          = selection from {HOUR,DAY,WEEK,MONTH,YEAR}. Defaults to "DAY,MONTH,YEAR"
 +
|timelinesize            = Timeline height. (Defaults to 350px)
 +
<s>|{{GREEN|key_events}}   =Name of important events, which provide the images at the top</s>
 +
<s>|image        =Image to show in the sidebox</s>
 +
|{{PURPLE|wikipedia}}        = URL of the document's Wikipedia page, if any ''([[Property:Has wikipediaPage]])''
 +
|wikipedia_protection      = Set to 1 if the wikipedia page is edit protected, 0 or empty otherwise ''([[Property:Has wikipediaProtection]])''
 
}}
 
}}
 
</poem>
 
</poem>
 
</noinclude><includeonly>{{SMWObjectHeader|Timeline}}
 
</noinclude><includeonly>{{SMWObjectHeader|Timeline}}
__NOCACHE__
+
 
{{#if: {{{position|}}}|
+
{{#if: {{{wikipedia|}}}|[[Has wikipediaPage2::{{{wikipedia}}}| ]]}}{{#if: {{{WP|}}}|[[Has wikipediaPage::{{{WP}}}| ]]}}{{#if: {{{timelineposition|}}}|{{#if: {{{key_events|}}}|Key events:{{#arraymap: {{{key_events|}}}|,|@@@|[[@@@]]}}}}
{{#if: {{{key_events|}}}|Key events:{{#arraymap: {{{key_events|}}}|,|@@@|[[@@@]]}}}}
+
{{#ask: {{#if: {{{expression|}}}|{{{expression}}}|[[Display at::{{FULLPAGENAME}}]]}}
{{#if: {{{events|}}}|[[Form:{{{events}}}|Add an event]] - [[Category:{{{events|}}}|Browse all events]] - [[WikiSpooks:Timelines|Help/information]] }}
 
{{#ask: [[Category:{{{category|}}}]]
 
|?Start
 
|?End
 
|sort=Start
 
|order=ascending
 
|height=300px
 
|format=chap-timeline
 
|template=ChapTLBox
 
|startproperty=Start
 
|endproperty=End
 
|cluster=true
 
|limit=150
 
}}
 
<hr/>
 
{{#ask: [[Category:{{{category|}}}]]
 
 
|?start
 
|?start
 
|?end
 
|?end
Line 43: Line 33:
 
|order=ascending
 
|order=ascending
 
|format=timeline
 
|format=timeline
|timelinesize=350px
+
|timelinesize={{#if: {{{timelinesize|}}}|{{{timelinesize}}}|350px}}
|timelineposition= {{{position|}}}
+
|timelineposition={{{timelineposition}}}
|timelinebands=WEEK,MONTH,YEAR
+
|timelinebands={{#if: {{{timelinebands|}}}|{{{timelinebands}}}|DAY,MONTH,YEAR}}
|Xstart=
+
|Xstart={{{timelinestart|}}}
|Xend=
+
|Xend={{{timelineend|}}}
 
|limit=200
 
|limit=200
}}|{{RED|Missing required parameter: {{t|position}}}}}}[[Category:Timelines]]{{SMWDocs}}
+
}}|{{RED|Missing required parameter: {{t|timelineposition}}}}}}[[Category:Timelines]]
 
</includeonly>
 
</includeonly>

Latest revision as of 09:59, 17 February 2018

SMWObjects
Semantic Object Templates:        DecadePlaceTimelineYearDisambiguation
ConceptDocumentEmploymentEventGroupPersonPublicationWebsite

This template is for timelines.

It should be included at the top of all timeline pages.

Blue parameters are for a single Wikispooks page name (If no suitable page exists, then pick a title for a future page)
Brown parameters are for numbers
Green parameters are for comma-separated lists of page names (Or planned page names).
Navy parameters are for dates
Orange parameters are for booleans. (Usually, either "Yes" or just leave blank).
Purple parameters are URLs.
Violet parameters are slash-separated lists.
Pink parameters are for coordinates.
Crossed out parameters were formerly available, but have been upgraded. Some may still work, but do not use these.

See timeline for a list of pages that use this template.

Usage:

{{Timeline
Required parameters:
|timelineposition =When the timeline is centered
Recommended parameters:
|timelinestart =The earliest point on the timeline
|timelineend =The latest point on the timeline
OPTIONAL SUBSECTIONS:
|expression = semantic web query to choose items. Defaults to "[[Display at::{{FULLPAGENAME}}]]"
|timelinebands = selection from {HOUR,DAY,WEEK,MONTH,YEAR}. Defaults to "DAY,MONTH,YEAR"
|timelinesize = Timeline height. (Defaults to 350px)
|key_events =Name of important events, which provide the images at the top
|image =Image to show in the sidebox
|wikipedia = URL of the document's Wikipedia page, if any (Property:Has wikipediaPage)
|wikipedia_protection = Set to 1 if the wikipedia page is edit protected, 0 or empty otherwise (Property:Has wikipediaProtection)
}}