Template:Legislation: Difference between revisions

From FOIwiki
Jump to navigationJump to search
OPSI link for local Acts
Simplify by using {{#ifexpr}}, whose existence I'd somehow managed to miss.
Line 22: Line 22:
{{#switch:{{{Type}}}
{{#switch:{{{Type}}}
   |ukpga =
   |ukpga =
     {{#switch:{{#expr:{{{Year}}} >= 1988}}
     {{#ifexpr:{{{Year}}} >= 1988
       |1=* [http://www.opsi.gov.uk/acts/acts{{{Year}}}/{{{Type}}}_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
       |* [http://www.opsi.gov.uk/acts/acts{{{Year}}}/{{{Type}}}_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
     }}
     }}
     {{#switch:{{#expr:{{{Year}}} >= 1963}}
    <!-- Pre-1963 Acts use regnal years, so mapping them to URLs has to be done by hand. -->
       |1=* [http://www.opsi.gov.uk/RevisedStatutes/Acts/ukpga/{{{Year}}}/cukpga_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Revised text on OPSI site]
     {{#ifexpr:{{{Year}}} >= 1963
    }}
       |* [http://www.opsi.gov.uk/RevisedStatutes/Acts/ukpga/{{{Year}}}/cukpga_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Revised text on OPSI site]
  |ukla =
    {{#switch:{{#expr:{{{Year}}} >= 1991}}
      |1=* [http://www.opsi.gov.uk/acts/localact{{{Year}}}/ukla_{{{Year}}}{{padleft:{{{Year}}}|4}}_en_1 Original text on OPSI site]
     }}
     }}
  |ukla = {{#ifexpr:{{{Year}}} >= 1991|* [http://www.opsi.gov.uk/acts/localact{{{Year}}}/ukla_{{{Year}}}{{padleft:{{{Year}}}|4}}_en_1 Original text on OPSI site]}}
   |asp =
   |asp =
* [http://www.opsi.gov.uk/legislation/scotland/acts{{{Year}}}/asp_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
* [http://www.opsi.gov.uk/legislation/scotland/acts{{{Year}}}/asp_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
* [http://www.opsi.gov.uk/RevisedStatutes/Acts/asp/{{{Year}}}/casp_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Revised text on OPSI site]
* [http://www.opsi.gov.uk/RevisedStatutes/Acts/asp/{{{Year}}}/casp_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Revised text on OPSI site]
   |ssi =
   |ssi = * [http://www.opsi.gov.uk/legislation/scotland/ssi{{{Year}}}/ssi_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
* [http://www.opsi.gov.uk/legislation/scotland/ssi{{{Year}}}/ssi_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
   |uksi = {{#ifexpr:{{{Year}}} >= 1987|* [http://www.opsi.gov.uk/si/si{{{Year}}}/Uksi_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1.htm Original text on OPSI site]}}
   |uksi =
   |wsi = {{#ifexpr:{{{Year}}} >= 1987|* [http://www.opsi.gov.uk/legislation/wales/wsi{{{Year}}}/wsi_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]}}
    {{#switch:{{#expr:{{{Year}}} >= 1987}}
   |nisr = {{#ifexpr:{{{Year}}} >= 1991|* [http://www.opsi.gov.uk/sr/sr{{{Year}}}/nisr_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]}}
      |1=* [http://www.opsi.gov.uk/si/si{{{Year}}}/Uksi_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1.htm Original text on OPSI site]
    }}
   |wsi =
    {{#switch:{{#expr:{{{Year}}} >= 1987}}
      |1=* [http://www.opsi.gov.uk/legislation/wales/wsi{{{Year}}}/wsi_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
    }}
   |nisr =
    {{#switch:{{#expr:{{{Year}}} >= 1991}}
      |1=* [http://www.opsi.gov.uk/sr/sr{{{Year}}}/nisr_{{{Year}}}{{padleft:{{{Number}}}|4}}_en_1 Original text on OPSI site]
    }}
}}{{#if:{{{SLD number|}}}|* {{SLD number|{{{SLD number|}}}}}
}}{{#if:{{{SLD number|}}}|* {{SLD number|{{{SLD number|}}}}}
}}<includeonly>{{#switch:{{{Type}}}
}}<includeonly>{{#switch:{{{Type}}}

Revision as of 00:12, 10 May 2010

This is the "Legislation" template. It's intended to be put in a page describing a piece of legislation. It puts the page in one of the categories under Category:Legislation. It should be called in the following format:

{{Legislation
|Type=ukpga|uksi|wsi|...
|Year=
|Number=
|Short title=
|SLD number=
}}
  • To link to this legislation, try {{{{{Type}}}|{{{Year}}}|{{{Number}}}}}.
  • Short title:
  • Legislation ID: {{{Type}}}/{{{Year}}}/{{{Number}}}