Difference between revisions of "Template:Address"

From Wayne County, Ohio Online Resource Center
Jump to navigation Jump to search
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>Use like:<pre>{{Address
 
<noinclude>Use like:<pre>{{Address
  | address=304 N. Market St.
+
  | number=304
 +
| street=N. Market St.
 
  | city=Wooster
 
  | city=Wooster
 
  | state=Ohio
 
  | state=Ohio
 
  | zip=44691
 
  | zip=44691
 +
| type=library
 
}}</pre>
 
}}</pre>
  
Line 9: Line 11:
  
 
{{Address
 
{{Address
| address=304 N. Market St.
+
| number=304
| city=Wooster
+
| street=N. Market St.
| state=Ohio
+
| city=Wooster
| zip=44691
+
| state=Ohio
 +
| zip=44691
 +
| type=library
 
}}
 
}}
 +
 +
Parameters are: <code>address</code>, <code>unit</code> (for apartment, suite, unit, etc. numbers), <code>city</code>, <code>state</code>, and <code>zip</code>. All parameters are optional. Additional parameters can be added (like <code>type</code> in the above example) to supply scripts with metadata.
  
 
==Development codeblock==
 
==Development codeblock==
 
<pre>
 
<pre>
{{#if: {{{address|}}}  
+
{{#if: {{{street|}}}  
  | [[{{{address}}}
+
  | {{#if: {{{number|}}}
 +
    |{{!((}}{{{number}}}&nbsp;
 +
    |{{!((}}
 +
  }}
 +
  {{{street}}}
 
   {{#if: {{{unit|}}}  
 
   {{#if: {{{unit|}}}  
 
     |, {{{unit}}}
 
     |, {{{unit}}}
Line 28: Line 38:
 
     |, {{{state}}}
 
     |, {{{state}}}
 
   }}
 
   }}
   {{!}}{{{address}}}
+
   {{!}}
    {{#if: {{{unit|}}}  
+
  {{#if: {{{number|}}}
      |, {{{unit}}}
+
    | {{{number}}}&nbsp;
    }}
+
  }}
 +
  {{{street}}}
 +
  {{#if: {{{unit|}}}  
 +
    |, {{{unit}}}
 +
  }}
 
   ]]
 
   ]]
 
}}
 
}}
{{#if: {{{city|}}}  
+
{{#if: {{{city|}}}
  | {{#if: {{{address|}}}
+
  | {{#if: {{{street|}}}
     |,  
+
     |, {{!((}}{{{city}}}
 +
    |{{!((}}{{{city}}}
 +
  }}
 +
  {{#if: {{{state|}}}
 +
    | ,
 +
    | {{!))}}
 
   }}
 
   }}
  [[{{{city}}}
 
    {{#if: {{{state|}}}
 
      | ,
 
      | ]]
 
    }}
 
 
  | {{#if: {{{state|}}}
 
  | {{#if: {{{state|}}}
     | [[
+
     | {{!((}}
 
   }}
 
   }}
 
}}
 
}}
 
{{#if: {{{state|}}}
 
{{#if: {{{state|}}}
  | {{{state}}}]]
+
  | {{{state}}}{{!))}}
}}
+
}}  
 
{{{zip|}}}
 
{{{zip|}}}
 
</pre>
 
</pre>
  
 +
==Code==
 +
 +
Edit this section to modify production code.
  
</noinclude><includeonly>{{#if: {{{address|}}}|[[{{{address}}}{{#if: {{{unit|}}}|, {{{unit}}}}}{{#if: {{{city|}}}|, {{{city}}}}}{{#if: {{{state|}}}|, {{{state}}}}}{{!}}{{{address}}}{{#if: {{{unit|}}}|, {{{unit}}}}}]]|}}{{#if: {{{city|}}}|{{#if: {{{address|}}}|, }}[[{{{city}}}{{#if: {{{state|}}}|, |]]}}|{{#if: {{{state|}}}|[[|}}}}{{#if: {{{state|}}}|{{{state}}}]]}} {{{zip|}}}</includeonly>
+
</noinclude><includeonly>{{#if: {{{street|}}}|{{#if: {{{number|}}}|{{!((}}{{{number}}}&nbsp;|{{!((}}}}{{{street}}}{{#if: {{{unit|}}}|, {{{unit}}}}}{{#if: {{{city|}}}|, {{{city}}}}}{{#if: {{{state|}}}|, {{{state}}}}}{{!}}{{#if: {{{number|}}}|{{{number}}}&nbsp;}}{{{street}}}{{#if: {{{unit|}}}|, {{{unit}}}}}]]|}}{{#if: {{{city|}}}| {{#if: {{{street|}}}|, {{!((}}{{{city}}}|{{!((}}{{{city}}}}}{{#if: {{{state|}}}|, |{{!))}}}}| {{#if: {{{state|}}}| {{!((}}}}}} {{#if: {{{state|}}} | {{{state}}}{{!))}}}} {{{zip|}}}</includeonly>

Latest revision as of 14:57, 25 August 2016

Use like:

{{Address
 | number=304
 | street=N. Market St.
 | city=Wooster
 | state=Ohio
 | zip=44691
 | type=library
}}

And you get:

304 N. Market St., Wooster, Ohio 44691

Parameters are: address, unit (for apartment, suite, unit, etc. numbers), city, state, and zip. All parameters are optional. Additional parameters can be added (like type in the above example) to supply scripts with metadata.

Development codeblock

{{#if: {{{street|}}} 
 | {{#if: {{{number|}}}
    |{{!((}}{{{number}}} 
    |{{!((}}
   }}
   {{{street}}}
   {{#if: {{{unit|}}} 
    |, {{{unit}}}
   }}
   {{#if: {{{city|}}} 
    |, {{{city}}}
   }}
   {{#if: {{{state|}}}
    |, {{{state}}}
   }}
   {{!}}
   {{#if: {{{number|}}}
    | {{{number}}} 
   }}
   {{{street}}}
   {{#if: {{{unit|}}} 
    |, {{{unit}}}
   }}
   ]]
}}
{{#if: {{{city|}}}
 | {{#if: {{{street|}}}
    |, {{!((}}{{{city}}}
    |{{!((}}{{{city}}}
   }}
   {{#if: {{{state|}}}
    | , 
    | {{!))}}
   }}
 | {{#if: {{{state|}}}
    | {{!((}}
   }}
}}
{{#if: {{{state|}}}
 | {{{state}}}{{!))}}
}} 
{{{zip|}}}

Code

Edit this section to modify production code.