Template:Infobox tour: Difference between revisions

added "safesubst" function and added check for unknown parameters
(this reders the years correctly in the chronology if "start date" and "end date" are 2 differen years)
(added "safesubst" function and added check for unknown parameters)
Line 1: Line 1:
{{Infobox
{{<includeonly>safesubst:</includeonly>#invoke:Unsubst-infobox||$params=name,photo,caption,alt,border,artist,performances,start_date,end_date,headliners,other_bands,supporting_acts,associated_album,legs,tour_mngr,chronology,last_tour,last_year,next_tour,next_year|$extra=border,caption,chronology|$aliases=Name>name,Photo>photo,image>photo,Image>photo,Caption>caption,Alt>alt,Border>border,Artist>artist,performances>performances,Start_Date>start_date,Start_date>start_date,End_Date>end_date,End_date>end_date,Headliners>headliners,Headliner>headliners,headliner>headliners,Other_Bands>other_bands,Other_bands>other_bands,Other_Band>other_bands,Other_band>other_bands,Supporting_Acts>supporting_acts,Supporting_acts>supporting_acts,Supporting_Act>supporting_acts,Supporting_act>supporting_acts,
Associated_Album>associated_album,Associated_album>associated_album,Legs>legs,Tour_Mngr>tour_mngr,Tour_mngr>tour_mngr,Chronology>chronology,Last_Tour>last_tour,Last_tour>last_tour,Last_Year>last_year,Last_year>last_year,Next_Tour>next_tour,Next_tour>next_tour,Next_Year>next_year,Next_year>next_year|$flags=override|$B=<!--
 
-->{{Infobox
| bodyclass  = vevent
| bodyclass  = vevent
| abovestyle  = color: inherit; background-color: {{#ifeq:{{Infobox concert/color|{{{name|}}}}}|khaki|{{Infobox concert/color}}|{{Infobox concert/color|{{{name|}}}}}}};
| abovestyle  = color: inherit; background-color: {{#ifeq:{{Infobox concert/color|{{{name|}}}}}|khaki|{{Infobox concert/color}}|{{Infobox concert/color|{{{name|}}}}}}};
Line 36: Line 39:
{{!}}- style="line-height: 1.4em;"
{{!}}- style="line-height: 1.4em;"
{{!}} style="width: 33%; text-align: center; vertical-align: top; padding: .2em .1em .2em 0" {{!}} {{#if:{{{last_tour|}}}|{{{last_tour}}}|}}<br />{{#if:{{{last_year|}}}|({{{last_year}}})|}}
{{!}} style="width: 33%; text-align: center; vertical-align: top; padding: .2em .1em .2em 0" {{!}} {{#if:{{{last_tour|}}}|{{{last_tour}}}|}}<br />{{#if:{{{last_year|}}}|({{{last_year}}})|}}
{{!}} style="width: 33%; text-align: center; vertical-align: top; padding: .2em .1em" {{!}} '''{{{name|{{PAGENAMEBASE}}}}}''' {{#if:{{{start_date|}}}|<br />({{#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}A|{{{start_date}}}|%d%d%d+}}| }}{{#ifeq:{{#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}A|{{{start_date}}}|%d%d%d+}}|{{#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}A|{{{end_date}}}|%d%d%d+}}|)|-{{#invoke:String|match|error_category=Music infoboxes with Module:String errors{{!}}A|{{{end_date}}}|%d%d%d+}})}}
{{!}} style="width: 33%; text-align: center; vertical-align: top; padding: .2em .1em" {{!}} '''{{{name|{{PAGENAMEBASE}}}}}''' {{#if:{{{start_date|}}}|<br />({{#invoke:String|match|error_category=Live infoboxes with Module:String errors{{!}}T|{{{start_date}}}|%d%d%d+}}| }}{{#ifeq:{{#invoke:String|match|error_category=Live infoboxes with Module:String errors{{!}}A|{{{start_date}}}|%d%d%d+}}|{{#invoke:String|match|error_category=Live infoboxes with Module:String errors{{!}}T|{{{end_date}}}|%d%d%d+}}||-{{#invoke:String|match|error_category=Live infoboxes with Module:String errors{{!}}T|{{{end_date}}}|%d%d%d+}}}}{{#if:{{{start_date|}}}|)}}  
{{!}} style="width: 33%; text-align: center; vertical-align: top; padding: .2em .1em .2em 0" {{!}} {{#if:{{{next_tour|}}}|{{{next_tour}}}|}}<br />{{#if:{{{next_year|}}}|({{{next_year}}})|}}
{{!}} style="width: 33%; text-align: center; vertical-align: top; padding: .2em .1em .2em 0" {{!}} {{#if:{{{next_tour|}}}|{{{next_tour}}}|}}<br />{{#if:{{{next_year|}}}|({{{next_year}}})|}}
{{!)}}
{{!)}}
}}
}}}}
}}
{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox tour with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox tour]] with unknown parameter "_VALUE_"|ignoreblank=y|name |photo |caption |alt |border |artist |performances |start_date |end_date |headliners |other_bands |supporting_acts |associated_album |legs |tour_mngr |chronology |last_tour |last_year |next_tour |next_year}}{{#if:{{#invoke:String|match|error_category=Live infoboxes with Module:String errors{{!}}A|1={{{last_tour|}}}{{{last_year|}}}{{{next_tour|}}}{{{next_year|}}}{{{name|}}}{{{image|}}}{{{photo|}}}{{{border|}}}{{{alt|}}}{{{caption|}}}{{{artist|}}}{{{performances|}}}{{{start_date|}}}{{{end_date|}}}{{{headliners|}}}{{{other_bands|}}}{{{supporting_acts|}}}{{{associated_album|}}}{{{legs|}}}{{{tour_mngr|}}}x|2=</?t[drh][ >]|nomatch=}}|{{main other|[[Category:Live infoboxes with malformed table placement|T]]}}}}}}<noinclude>
<noinclude>{{#ifeq:{{FULLPAGENAME}}|Template:Infobox tour/sandbox|{{Template sandbox notice}}|{{documentation}}}}
{{Documentation}}
{{#ifeq:{{FULLPAGENAME}}|Template:Infobox tour|}}[[Category:Infoboxes]]</noinclude>
<!-- Add categories to the /doc subpage, not here. -->
</noinclude>