Difference between revisions of "Template:Hansard"
Jump to navigation
Jump to search
imported>Bungle (set 1st parameter to allowbe unspecified url) |
imported>Bungle (additional params under house; remove text after # in url from title; allow for accessdate being specified) |
||
| Line 1: | Line 1: | ||
<includeonly>{{cite web |url=https://api.parliament.uk/historic-hansard/{{#switch: {{{house|}}} | <includeonly>{{cite web |url=https://api.parliament.uk/historic-hansard/{{#switch: {{{house|}}} | ||
| − | |commons=commons | + | |commons|c|hc=commons |
| − | |lords=lords | + | |lords|l|hl=lords |
| − | |written=written-answers | + | |written|w|wa=written-answers |
|#default=commons | |#default=commons | ||
| − | }}/{{{url|{{{1|}}}}}} |title={{#if: {{{title|}}}|{{{title|}}}|{{Title case|{{replace|{{str sub new|{{{url|{{{1|}}}}}}|13}}|-| }}}} ({{str sub new|{{{url|{{{1|}}}}}}|1|4}}) }} |publisher=Historic Hansard |date={{trim leading|{{str sub new|{{{url|{{{1|}}}}}}|10|11}}}} {{monthname|{{str sub new|{{{url|{{{1|}}}}}}|6|8}}}} {{str sub new|{{{url|{{{1|}}}}}}|1|4}} |access-date={{{accessed|{{{access-date|}}}}}} }}</includeonly> | + | }}/{{{url|{{{1|}}}}}} |title={{#if: {{{title|}}}|{{{title|}}}|{{Title case|{{replace|{{Remove last word|{{str sub new|{{{url|{{{1|}}}}}}|13}}|sep=#}}|-| }}}} ({{str sub new|{{{url|{{{1|}}}}}}|1|4}}) }} |publisher=Historic Hansard |date={{trim leading|{{str sub new|{{{url|{{{1|}}}}}}|10|11}}}} {{monthname|{{str sub new|{{{url|{{{1|}}}}}}|6|8}}}} {{str sub new|{{{url|{{{1|}}}}}}|1|4}} |access-date={{{accessed|{{{access-date|{{{accessdate|}}}}}}}}} }}</includeonly> |
<noinclude> | <noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> | ||
Revision as of 12:33, 28 April 2020
| File:Ambox warning yellow.svg | This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
Contents
Usage
{{Hansard|URL|Title (optional)|House (optional)|Access-date (optional)}}
This template is used for auto generating a citation when using Historic Hansard (UK Parliament) as a reference. It will determine the date from the url and generate a title from the url (both of which are stored in the url). Only part of the url needs to be entered into the parameter (from the year onwards).
Parameters
|URL=address, mandatory, defines the url portion from the year onwards (can also be specified as first parameter without the url=)|title=TITLE, optional, specifies a manual title (default title is taken from the url)|house=NAME, optional, defines whether it relates to commons, lords or written (default commons)|accessdate=DATE, optional, defines the access-date (also works as "accessed" and "access-date")
Example
If the url is https://api.parliament.uk/historic-hansard/commons/1914/aug/07/royal-assent, only the part from "1914" should be entered. For example,
{{Hansard|url=1914/aug/07/royal-assent |access-date=1 January 2010}}
| The above documentation is transcluded from Template:Hansard/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |