Difference between revisions of "Template:Infobox"

From Culture.si
Line 87: Line 87:
 
| save      = TRUE
 
| save      = TRUE
 
}}{{#set:localname={{#if:{{{localname|{{{local name|{{{name}}}}}}}}}|{{{localname|{{{local name|{{{name}}}}}}}}}|{{{name|{{FULLPAGENAME}}}}}}}}}{{#if:{{{town|}}}
 
}}{{#set:localname={{#if:{{{localname|{{{local name|{{{name}}}}}}}}}|{{{localname|{{{local name|{{{name}}}}}}}}}|{{{name|{{FULLPAGENAME}}}}}}}}}{{#if:{{{town|}}}
|{{infoboxRow
+
| {{{
   | label = Region
+
   townName = {{#str:replace|{{{town}}}|^[A-Z][A-Z]-\S+ |}}
  | name  = Region
+
  zip = {{#str:replace|{{{town}}}|^([A-Z][A-Z]-\S+) .*$|$1}}
  | value = {{{region|{{#custom:sub|{{{town|}}}|0|4}}}}}
+
  }}}
   | type  = text
+
   {{#ifeq:{{{town}}}|{{{townName}}}||
}}{{infoboxRow
+
    {{#ifeq:{{#str:substr|{{{zip}}}|0|2}}|SI|
  | label = Zip
+
      {{infoboxRow
  | name  = Zip
+
      | label = Region
  | value = {{{region|{{#custom:sub|{{{town|}}}|0|7}}}}}
+
      | name  = Region
  | type  = hidden
+
      | value = {{{region|{{#str:substr|{{{town|}}}|0|4}}}}}
}}{{infoboxRow
+
      | type  = text
  | label = TownName
+
      }}
  | name  = TownName
+
    }}
  | value = {{{region|{{#custom:sub|{{{town|}}}|8}}}}}
+
    {{infoboxRow
  | type  = hidden
+
    | label = Zip
}}}}{{infoboxRow
+
    | name  = Zip
 +
    | value = {{{zip}}}
 +
    | type  = hidden
 +
    }}{{infoboxRow
 +
    | label = TownName
 +
    | name  = TownName
 +
    | value = {{{townName}}}
 +
    | type  = hidden
 +
    }}
 +
  }}
 +
}}
 +
{{infoboxRow
 
| label = Post
 
| label = Post
 
| hidden = TRUE
 
| hidden = TRUE

Revision as of 21:03, 12 February 2014

Prekopiraj spodnjo strukturo v izvorno kodo članka. Pri Image vpiši samo ime slike.

{{Infobox
| name               =
| local name         =
| logo               = 
| image              = 
| street             = 
| town               = 
| region             = ''if not in Slovenia'' 
| country            = ''if not in Slovenia''
| website            = 
| email              = 
| telephone          = 
| fax                = 
| founded by         =
| founded by 2       =
| founded by 3       =
| founded by 4       =
| organised by       =
| organised by 2     =
| organised by 3     =
| managed by         = 
| managed by 2       = 
| managed by 3       = 
| published by       =
| published by 2     = 
| published by 3     =
| opening hours      =
| official hours     =
| frequency          =
| dates and duration = 
| duration weeks     = for festivals
| contacts     = {{Contact
  | name        = 
  | role        =
  | street      = 
  | town        = 
  | website     = 
  | email       = 
  | telephone   = 
  | fax         = 
  }}{{Contact
  | name        = 
  | role        =
  | street      = 
  | town        = 
  | website     = 
  | email       = 
  | telephone   = 
  | fax         = 
  }}{{Contact
  | name        = 
  | role        =
  | street      = 
  | town        = 
  | website     = 
  | email       = 
  | telephone   = 
  | fax         = 
  }}
}}