Difference between revisions of "Template:Address"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
<noinclude>Use like:<pre>{{Address | <noinclude>Use like:<pre>{{Address | ||
− | | address= | + | | number=304 |
+ | | address=N. Market St. | ||
| city=Wooster | | city=Wooster | ||
| state=Ohio | | state=Ohio | ||
Line 10: | Line 11: | ||
{{Address | {{Address | ||
− | | address= | + | | number=304 |
+ | | address=N. Market St. | ||
| city=Wooster | | city=Wooster | ||
| state=Ohio | | state=Ohio | ||
Line 21: | Line 23: | ||
==Development codeblock== | ==Development codeblock== | ||
<pre> | <pre> | ||
− | {{#if: {{{ | + | {{#if: {{{street|}}} |
− | | [[{{{ | + | | [[ |
+ | {{#if: {{{number|}}} | ||
+ | |{{{number}}} | ||
+ | }} | ||
+ | {{{street}}} | ||
{{#if: {{{unit|}}} | {{#if: {{{unit|}}} | ||
|, {{{unit}}} | |, {{{unit}}} | ||
Line 32: | Line 38: | ||
|, {{{state}}} | |, {{{state}}} | ||
}} | }} | ||
− | {{!}}{{{ | + | {{!}}{{{street}}} |
{{#if: {{{unit|}}} | {{#if: {{{unit|}}} | ||
|, {{{unit}}} | |, {{{unit}}} | ||
Line 39: | Line 45: | ||
}} | }} | ||
{{#if: {{{city|}}} | {{#if: {{{city|}}} | ||
− | | {{#if: {{{ | + | | {{#if: {{{street|}}} |
|, {{!((}}{{{city}}} | |, {{!((}}{{{city}}} | ||
|{{!((}}{{{city}}} | |{{!((}}{{{city}}} | ||
Line 61: | Line 67: | ||
Edit this section to modify production code. | Edit this section to modify production code. | ||
− | </noinclude><includeonly>{{#if: {{{ | + | </noinclude><includeonly>{{#if: {{{street|}}}|[[{{#if: {{{number|}}}|{{{number}}} }}{{{street}}}{{#if: {{{unit|}}}|, {{{unit}}}}}{{#if: {{{city|}}}|, {{{city}}}}}{{#if: {{{state|}}}|, {{{state}}}}}{{!}}{{{street}}}{{#if: {{{unit|}}}|, {{{unit}}}}}]]|}}{{#if: {{{city|}}}| {{#if: {{{street|}}}|, {{!((}}{{{city}}}|{{!((}}{{{city}}}}}{{#if: {{{state|}}}|, |{{!))}}}}| {{#if: {{{state|}}}| {{!((}}}}}} {{#if: {{{state|}}} | {{{state}}}{{!))}}}} {{{zip|}}}</includeonly> |
Revision as of 14:32, 25 August 2016
Use like:
{{Address | number=304 | address=N. Market St. | city=Wooster | state=Ohio | zip=44691 | type=library }}
And you get:
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}}} }} {{!}}{{{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.