Bản mẫu:Title monthname

Tài liệu bản mẫu[xem] [sửa] [lịch sử] [làm mới]

Extracts from a page title the name of a month (January, February, March etc). Returns nothing if there is no match.

Note that the monthname in the title must properly capitalised. "October" will be matched, but "october" or "OCTOBER" will be ignored.

Some options allow its behaviour to be configured.

Cách sử dụng sửa

Cách sử dụng cơ bản sửa

{{Title monthname}}

This usage will return the first word in the title which matches the correctly-capitalised name of a month.

If no match is found, it returns an empty string. This allows its simple use in templates, e.g.

{{#if: {{Title monthname}}|<!-- do nothing if there is a match -->|This page's title does not include a month}}

Các tham số tùy chọn sửa

Three optional parameters are available:

  1. |page=value
    This forces the template to use a title other than the current page
  2. |nomatch=value
    This parameter is used to specify a message to be generate if no match is found. For example
    • Default output {{Title monthname|page=All Watched Over by Machines of Loving Grace}}
    • with nomatch {{Title monthname|page=All Watched Over by Machines of Loving Grace|nomatch=No month!}} → No month!
  3. |match=number
    If multiple month names are found, this specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1.
    Ví dụ:
    • {{Title monthname|page=Events in June, July, or August|match=3}}
    • {{Title monthname|page=Riots in February, March, April, May, June, or July (and maybe November)|match=-2}}

Dữ liệu bản mẫu sửa

Đây là tài liệu Dữ liệu bản mẫu cho bản mẫu này được sử dụng bởi Trình soạn thảo trực quan và các công cụ khác; xem báo cáo sử dụng tham số hàng tháng cho bản mẫu này.

Dữ liệu bản mẫu cho Title monthname

Extracts a 3- or 4-digit year from the current page title. All parameters are optional.

Tham số bản mẫu[Quản lý Dữ liệu bản mẫu]

Tham sốMiêu tảKiểuTrạng thái
Match Instancematch

If multiple monthnames are found, this specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1.

Mặc định
1
Sốtùy chọn
No match textnomatch

If no monthname is found, output the "nomatch" value. Defaults to blank.

Chuỗi dàitùy chọn
Override page titlepage

Specified a page title to use other than the current page. If left blank, the template will use the title of the current page

Mặc định
{{BASEPAGENAME}}
Tên trangtùy chọn

Xem thêm sửa