Difference between revisions of "Template:Location"

From Nottinghack Wiki
Jump to navigation Jump to search
(Parent parameter)
(→‎Documentation: expand an cat)
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| class="wikitable" {{#ifeq: {{{defunct}}}|yes|style="float:right; width:300px; margin-left:10px; margin-bottom:10px; color: DarkSlateGray;"|style="float:right; width:300px; margin-left:10px;" }} <!-- make text grey if defunct -->
+
{| class="wikitable" <!--
! colspan="2" {{#ifeq: {{{defunct}}}|yes|style="background-color:DarkSlateGray; color:#ffffff; text-align: center; border: 1px solid #244724;"|style="background-color:#195905; color:#ffffff; text-align: center; border: 1px solid #244724;" }} | {{{name|{{SUBPAGENAME}}}}} {{#ifeq: {{{defunct}}}|yes|&nbsp;(defunct)}}
+
-->{{#ifeq: {{{past}}}|yes|style="float:right; width:300px; margin-left:10px; margin-bottom:10px; color: DarkSlateGray;"|style="float:right; width:300px; margin-left:10px;" }} <!-- make text grey if defunct -->
  |- {{#if: {{{image|}}} | | style="display: none;" }}
+
! colspan="2" {{#ifeq: {{{past}}}|yes|style="background-color:DarkSlateGray; color:#ffffff; text-align: center; border: 1px solid #244724;"|style="background-color:#195905; color:#ffffff; text-align: center; border: 1px solid #244724;" }} | {{{name|{{SUBPAGENAME}}}}} {{#ifeq: {{{past}}}|yes|&nbsp;(past)}}
  ! colspan="2" style="text-align:center;" | [[{{{image}}}|frameless|{{#ifexpr: {{{imagewidth|280}}}>280|280|{{{imagewidth|280}}}}}px|center]]
+
  |- {{#if: {{{image|}}} | | style="display: none;" }}
  |- {{#if:{{{use|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
+
  ! colspan="2" style="text-align:center;" | [[{{{image}}}|frameless|{{#ifexpr: {{{imagewidth|280}}}>280|280|{{{imagewidth|280}}}}}px|center]]<!-- --><!--
  ! Intended Use
+
-->
  | {{{use}}}
+
  |- {{#if:{{{use|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
  |- {{#if:{{{floor|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
+
  ! Intended Use
  ! Floor
+
  | {{{use}}}<!-- --><!--
  | {{#switch:{{lc:{{{floor|}}}}}|upstairs=[[Hackspace 2.0|Upstairs]]|downstairs=[[Hackspace 2.5|Downstairs]]|#default={{{floor}}} }}
+
-->
  |-
+
  |- {{#if:{{{manufacturer|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
  |- {{#if:{{{parentlocation|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
+
  ! Manufacturer
  ! Located within
+
  | {{{manufacturer}}}<!-- --><!--
  | {{{parentlocation}}}
+
-->
  |-
+
  |- {{#if:{{{model|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
  ! Team
+
  ! Model
  | {{#if: {{{team|}}}|[[Team:{{{team|}}}|{{{team|}}}]]|[[Team:Infrastructure|Infrastructure]] }}
+
  | {{{model}}}
  |- {{#if: {{{floorplanimage|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist -->}}
+
  |- <!-- None optional row below --><!-- --><!--
  ! Map
+
-->
  | [[{{{floorplanimage}}}|frameless|{{#ifexpr: {{{imagewidth|220}}}>220|220|{{{imagewidth|220}}}}}px|center]]
+
  ! Team
  |-
+
  | {{#if: {{{team|}}}|[[Team:{{{team|}}}|{{{team|}}}]]|[[Team:Infrastructure|Infrastructure]] }}<!-- --><!--
  | colspan="2" style="text-align: center; border: 1px solid #244724; "|<small> '''Locations:''' &nbsp; [[:Category:Location|all pages]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[Template:Location |{{}}]]</small>
+
-->
 +
  |- {{#if:{{{floor|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
 +
  ! Floor
 +
  | {{#switch:{{lc:{{{floor|}}}}}|upstairs=[[Hackspace 2.0|Upstairs]]|downstairs=[[Hackspace 2.5|Downstairs]]|#default={{{floor}}} }}<!-- --><!--
 +
-->
 +
  |- {{#if:{{{parentlocation|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist --> }}
 +
  ! Area
 +
  | [[{{{parentlocation}}}]]<!-- --><!--
 +
-->
 +
  |- {{#if: {{{floorplanimage|}}} | | style="display: none;" <!-- Hide row if parameter doesn't exist -->}}
 +
  ! Map
 +
  | [[{{{floorplanimage}}}|frameless|{{#ifexpr: {{{imagewidth|220}}}>220|220|{{{imagewidth|220}}}}}px|center|link={{#if: {{{parentlocation|}}} |{{{parentlocation|}}} |{{#if:{{{floor|}}} |{{{floor|}}} |The Space}} }}]]
 +
  |-
 +
  | colspan="2" style="text-align: center; border: 1px solid #244724; "|<small> '''Locations:''' &nbsp; [[:Category:Location|all pages]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[Template:Location |{{}}]]</small>
 
|}
 
|}
{{#if:{{{parentlocation|}}}|[[Category:Sub-Location]]|[[Category:Location]]}}
+
<includeonly>{{#ifeq:{{NAMESPACE}} ||<!--then--> {{#ifeq: {{{past}}}|yes|{{#if:{{{parentlocation|}}}|[[Category:Sub-Location (past)]]|[[Category:Location (past)]]}}|{{#if: {{{team|}}}|[[Category:Responsibility of Team:{{{team|}}}]]|[[Category:Responsibility of Team:Infrastructure]]}}{{#if:{{{parentlocation|}}}|[[Category:Sub-Location]][[Category:Sub-Location of {{{parentlocation}}}]]|[[Category:Location]]}} }} }}</includeonly>
 
<noinclude>
 
<noinclude>
 
{{clear}}
 
{{clear}}
 
== Documentation ==
 
== Documentation ==
 +
This template makes an [[Wikipedia:Infobox|infobox]] for [[:Category:Location|locations]] and [[:Category:Sub-Location|sub-locations]].
  
 
All arguments are optional, but you should have at least 1 (ideally more). Don't worry about the way it looks on this page: that's purely because no arguments are specified.
 
All arguments are optional, but you should have at least 1 (ideally more). Don't worry about the way it looks on this page: that's purely because no arguments are specified.
 +
 +
If this template in used in the main wiki [[Help:Reference_guide#Namespaces|namespace]] - it with automatically be added to [[:category:location]] (or relevant sub-category).
  
 
===Usage===
 
===Usage===
Line 61: Line 77:
 
;floorplanimage
 
;floorplanimage
 
:An image, in the format File:<image name>.<ext>. DO NOT include the <nowiki>[[]]</nowiki> brackets otherwise the image will display full size.
 
:An image, in the format File:<image name>.<ext>. DO NOT include the <nowiki>[[]]</nowiki> brackets otherwise the image will display full size.
 +
;manufacturer
 +
:Some sub-locations have specific manufacturers (for example, [[SlimJim]]).
 +
;model
 +
:Some sub-locations have specific models (for example, [[SlimJim]]).
 +
;past
 +
:If the location is no longer part of the space, or has been used for something else use past=yes.
 +
 +
====Extended arguments====
 +
;manufacturer
 +
:Some sub-locations have specific manufacturers (for example, [[SlimJim]]).
 +
;model
 +
:Some sub-locations have specific models (for example, [[SlimJim]]).
 +
 +
[[Category:Templates infoboxes]]
 +
 +
==See also==
 +
* [[Template:Location List]]
 +
 
[[Category:Templates infoboxes]]
 
[[Category:Templates infoboxes]]
 
</noinclude>
 
</noinclude>

Latest revision as of 16:29, 22 January 2020

Location
[[{{{image}}}|frameless|280px|center]]
Intended Use {{{use}}}
Manufacturer {{{manufacturer}}}
Model {{{model}}}
Team Infrastructure
Floor {{{floor}}}
Area [[{{{parentlocation}}}]]
Map [[{{{floorplanimage}}}|frameless|220px|center|link=The Space]]
Locations:   all pages                 {{}}


Documentation

This template makes an infobox for locations and sub-locations.

All arguments are optional, but you should have at least 1 (ideally more). Don't worry about the way it looks on this page: that's purely because no arguments are specified.

If this template in used in the main wiki namespace - it with automatically be added to category:location (or relevant sub-category).

Usage

Inserting the following text at the top of the tool page will produce an information box on your page that gives an overview of the tool. Arguments can be written in any order.

Images look great with this template, include one if you can!

Abbreviated parameter list:

{{Location
|image=
|team=
|use=
|floor=
|parentlocation=
|floorplanimage=
}}

Arguments

image
An image, in the format File:<image name>.<ext>. DO NOT include the [[]] brackets otherwise the image will display full size.
team
Team responsible for looking after the area. Defaults to 'infrastructure'. Use name of team only without the 'Team:' prefix or double square brackets. For example, for Team:Laser use use 'team=Laser'. See category:Teams for Team names.
use
Use to describe the intended purpose of the area
floor
Use to note the level the location is on. Use: Upstairs or Downstairs.
parentlocation
Used for assigning a "parent" room for objects and storage locations.
floorplanimage
An image, in the format File:<image name>.<ext>. DO NOT include the [[]] brackets otherwise the image will display full size.
manufacturer
Some sub-locations have specific manufacturers (for example, SlimJim).
model
Some sub-locations have specific models (for example, SlimJim).
past
If the location is no longer part of the space, or has been used for something else use past=yes.

Extended arguments

manufacturer
Some sub-locations have specific manufacturers (for example, SlimJim).
model
Some sub-locations have specific models (for example, SlimJim).

See also