Template talk:Cite legislation UK

Link to schedule
Is it possible to link to a schedule, as opposed to a section? If not, could this functionality be added? Hairy Dude (talk) 14:13, 21 August 2019 (UTC)
 * Apparently, yes: schedule. —[  Alan M 1 (talk) ]— 01:12, 3 December 2019 (UTC)

Translate legislation references like "14 Car 2 c 12"?
I don't expect a template like this (designed to formalise legislation citations) to be able to provide this 'on the fly', but maybe someone can suggest a possible mechanism?

On a number of occasions recently, I have found [outside Wikipedia] citations in the style "14 Car 2 c 12" and haven't been able to convert that notation to an 'AAAAAAAA Act yyyy' notation. Does anybody know of a translation service? I know it means something like "Chapter 12 of the 2nd Act of the Reign of Charles II", but that does not advance the search in any significant way. I have in mind something like template:coord does.

(As a test case, 14 Car 2 c 12 should deliver Poor Relief Act 1662). --Red King (talk) 11:11, 17 February 2020 (UTC)
 * I don't know of any services that offer that as unfortunately even legislation.gov.uk doesn't hold wholly repealed acts. It might be something possible in Wikidata perhaps needing a new identifier. Nthep (talk) 12:37, 17 February 2020 (UTC)
 * I noticed u|Jnestorius using   and it works!, so it is possible to use the Regnal notation as well as the civil one. So at least some of my wish can be granted without extra work. (That particular 525-year-old act remains at legislation.gov.uk because it continues to apply to Northern Ireland. My test case fails, unfortunately, because it has been repealed. --Red King (talk) 11:22, 25 February 2020 (UTC)
 * There is, unfortunately, more recent legislation that uses that notation, e.g. the Aliens Restriction (Amendment) Act 1919 which is 9–10 Geo. 5 c. 92. It surely can't be too hard to add a parameter or two to accommodate this, e.g. in this case citeyear=9–10 Geo. 5 used in the text, leaving year=Geo5/9-10 for the URL. In this case year=1919 works for the URL, but cites the act as 1919 c. 92 which I believe is incorrect. Hairy Dude (talk) 22:13, 2 December 2020 (UTC)

Duplication?
Do we now have two templates (this one and template:UK-LEG) doing the same thing? --Red King (talk) 11:22, 25 February 2020 (UTC)

Template should not have default values
Take this example:

which produces

exactly as it described. But suppose the editor thinks "do we really need 1896 three times?" and decides to just drop the "|year=", thus:

which produces

exactly as it should not. Instead of the year being omitted, we get "1978" and worse still, the legislation fetched is "Housing (Financial Provisions) (Scotland) Act 1978" (because that is the Act at 1978 c14).

I know the workaround is to include a null value "year=" argument thus:

which produces

which does have the desired result.

In the case where a new editor asked for my help, they had written "|Year=1896" and been totally flummoxed by getting some random modern legislation.

Clearly, "year" is a mandatory element, so its omission should generate an error message and not some lazy default substitution. Is there any convincing reason for the template to have any defaults? --John Maynard Friedman (talk) 11:26, 8 November 2020 (UTC)
 * Agreed. There is no good rationale for defaulting to the Interpretation Act. It's almost as if defaulted to the Oxford English Dictionary – there is no reason to use it that way. More generally, I think it would be better to replace this and similar templates such as  with a Lua module that can more elegantly handle stuff like this. It could also handle regnal year citation such as translating "Geo5/9-10" (the URL fragment used by legislation.gov.uk) into "9–10 Geo. 5" for the text. That would also produce error messages if any required parameters such as year are missing. Hairy Dude (talk) 22:22, 2 December 2020 (UTC)

Mode
Could a mode parameter be added to allow switching to appropriate CS1 or CS2 style output so this can be matched to other cites in an article. Keith D (talk) 12:16, 14 July 2021 (UTC)

"regulation", "article" or "rule" instead of "section" for statutory instruments
Currently you can cite a "section" of an enactment. However, statutory instruments don't have sections. The equivalent for Regulations, Orders and Rules are 'regulations', 'articles' and 'rules' respectively. Since legislation.gov.uk uses the same URL scheme for all of these, it's not possible to auto-detect which should be used - but we should be able to use something besides the incorrect "section". Hairy Dude (talk) 06:23, 9 January 2022 (UTC)

How to link to Introduction, and to whole act?

 * This section and the next one,, refer to the same issue
 * Possible solution for this suggested in next section, . Pol098 (talk) 14:12, 28 December 2022 (UTC)

The template can link to a numbered section; is it possible for it to link to the Introduction? A link to a section is generated by the template, for example:

which links to:

https://www.legislation.gov.uk/ukpga/Geo5/1-2/13/section/1/enacted

The URL of the introduction is like

https://www.legislation.gov.uk/ukpga/Geo5/1-2/13/introduction

but as far as I know the template can't generate it (as of today).

Similarly, is it possible to link to the whole act? URL is like

https://www.legislation.gov.uk/ukpga/Geo5/1-2/13

Best wishes, Pol098 (talk) 15:09, 11 December 2022 (UTC)

Links are 404

 * This section and the previous one,, refer to the same issue

This template is used at Bail in the United Kingdom where it generates links that are 404. is one example of this usage, but as far as I can tell all of the invocations of this template at that page to generate a reference end up linking to a "page not found" error. -- Mikeblas (talk) 15:52, 26 December 2022 (UTC)
 * For information: the (404) link generated by the template for the example given is (still the case Feb 23) https://www.legislation.gov.uk/ukpga/1984/60/section/47ZE/enacted The correct link needed is https://www.legislation.gov.uk/ukpga/1984/60/section/47ZE  I have corrected this particular error in Bail in the United Kingdom by not using a template, but others remain. Best wishes, Pol098 (talk) 15:05, 27 December 2022 (UTC)
 * It looks like when a link to a section of an act is required the switch  doesn't need to be there. I think this switch is only needed if the link desired is to the whole act as it was enacted Nthep (talk) 12:52, 28 December 2022 (UTC)
 * Taking this section and the previous one, together, we have several URL formats that may need to be generated: https://www.legislation.gov.uk/ukpga/1984/60 https://www.legislation.gov.uk/ukpga/1984/60/introduction https://www.legislation.gov.uk/ukpga/1984/60/section/47ZE/enacted https://www.legislation.gov.uk/ukpga/1984/60/section/47ZE  and possibly others. I don't know if it's worth doing—amongst other things it will require the user to know what the URL should be—but an additional template parameter called perhaps   with values ,  ,   (default) and   would add flexibility. Maybe even a value   with an additional parameter  , where any text could be appended to the URL of the whole act:  . Best wishes, Pol098 (talk) 14:07, 28 December 2022 (UTC)

More of a note-to-self than anything else, but...
How to translate from a link to an Act to the citation template:

Example Act link: www.legislation.gov.uk/ukpga/2006/38/section/55

We don't need to ask any more than that and for a lot of people it's easier to work backwards from the URL than try to work forwards from the weird UKPGA data. — Trey Maturin™ 20:38, 28 August 2023 (UTC)