Bản mẫu:Wikidata URL/doc

Bách khoa toàn thư mở Wikipedia

Cách sử dụng[sửa mã nguồn]

Converts URLs from Wikidata of the format http:// to http:// so that they can be used to generate external links.

{{Wikidata URL|1=URL}}

{{Wikidata URL|P=ID Wikidata hoặc tiêu đề của thuộc tính URL|from=ID Wikidata của thực thể nguồn}}

  • Parameter |1=, URL, is optional. If included, the specified URL will be converted to http://, and all other parameters will be ignored.
  • Parameter |P=, if specified, is the ID or name of the property that contains the URL. If it is not specified, it defaults to trang chủ chính thức (P856).
  • Parameter |from=, if specified, is the ID of the Wikidata entity to fetch the URL property from. If it is not specified, it defaults to the current page.

Các ví dụ[sửa mã nguồn]

{{Wikidata URL|1={{#property:P1630|from=p830}}}}https://eol.org/pages/$1

{{Wikidata URL|P=formatter URL|from=P830}}

Thất bại khi kết xuất thuộc tính formatter URL: Không tìm thấy thuộc tính formatter URL.

{{Wikidata URL|P=P1630|from=P830}}https://eol.org/pages/$1

{{Wikidata URL|from=Q328}}https://en.wikipedia.org/

{{Wikidata URL}} (khi được đặt trên https://en.wikipedia.org/wiki/English_Wikipedia) → https://en.wikipedia.org/

{{Wikidata URL|1={{#property:P1630|from=p830}}|P=P856|from=Q328}}https://eol.org/pages/$1 (|P=|from= bị bỏ qua)

Xem thêm[sửa mã nguồn]