Bản mẫu:Website chính thức/doc

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

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

Sử dụng[sửa mã nguồn]

Dùng bản mẫu này để liên kết đến các website chính thức. Tham số bắt buộc duy nhất là địa chỉ của trang web. Tuy nhiên nếu muốn sửa tiêu đề liên kết (khi tiêu đề mặc định "Website chính thức" không phù hợp), ta có thể dùng thêm tham số |name=

Nếu một số URL chứa các kí tự đặc biệt như & hay =, bản mẫu có thể sẽ bị hỏng hoặc không hiển thị như mong muốn. Nếu vậy, bạn có thể thêm trước địa chỉ web |url= hoặc đơn giản hơn, |1=.

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

URL trên bản mẫu[sửa mã nguồn]

Ở bên phải của mỗi ví dụ là đầu ra được hiển thị. Dưới đây mỗi ví dụ là đầu ra thực tế bao gồm các thẻ <span>...</span>.

  • {{website chính thức|example.org}}Website chính thức
    <span class="official-website"><span class="url">[http://example.org Website chính thức]</span></span>
  • {{website chính thức|www.example.org}}Website chính thức
    <span class="official-website"><span class="url">[http://www.example.org Website chính thức]</span></span>
  • {{website chính thức|//www.example.org}}Website chính thức
    <span class="official-website"><span class="url">[//www.example.org Website chính thức]</span></span>
  • {{website chính thức|http://www.example.org}}Website chính thức
    <span class="official-website"><span class="url">[http://www.example.org Website chính thức]</span></span>
  • {{website chính thức|https://www.example.org}}Website chính thức
    <span class="official-website"><span class="url">[https://www.example.org Website chính thức]</span></span>
  • {{website chính thức|1=https://example.org/?action=view}}Website chính thức
    <span class="official-website"><span class="url">[https://example.org/?action=view Website chính thức]</span></span>
  • {{website chính thức|https://example.org|name=Ví dụ}}Ví dụ
    <span class="official-website"><span class="url">[https://example.org Ví dụ]</span></span>
  • {{website chính thức|https://example.org|mobile=https://m.example.org}}Website chính thức (Di động)
    <span class="official-website"><span class="url">[https://example.org Website chính thức]</span></span> (<span class="url">[https://m.example.org Di động]</span>)
  • {{website chính thức|https://example.org|format=flash}}Website chính thức (Yêu cầu Adobe Flash Player)
    <span class="official-website"><span class="url">[https://example.org Website chính thức]</span></span> <span style="font-size:0.95em; font-size:90%; color:#555">(Yêu cầu [[Adobe Flash Player]])</span>

URL trên Wikidata[sửa mã nguồn]

Cách sử dụng trong bài viết Amazon (công ty):

  • {{website chính thức}}Website chính thức Sửa đổi này tại Wikidata
    <span class="official-website"><span class="url">[https://www.amazon.com Official website]</span></span> [[Tập tin:Blue pencil.svg |frameless |text-top |10px |alt=Sửa đổi này tại Wikidata |link=https://www.wikidata.org/wiki/Q3884#P856|Sửa đổi này tại Wikidata]]

Lưu ý: Nếu Wikidata giữ hai hoặc nhiều giá trị, bằng các ngôn ngữ khác nhau, trang web bằng tiếng Anh sẽ được sử dụng.

Không có URL trên bản mẫu hoặc Wikidata[sửa mã nguồn]

Sử dụng trên bất kỳ trang nào không có URL trên thuộc tính Wikidata trang chủ chính thức (P856):

  • {{website chính thức}}Không tìm thấy URL. Vui lòng định rõ một URL ở đây hoặc thêm vào trên Wikidata.
    <strong class="error">Không tìm thấy URL. Vui lòng định rõ một URL ở đây hoặc thêm vào trên Wikidata.</strong>

Dữ liệu bản mẫu[sửa mã nguồn]

Đâ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 Website chính thức

The purpose of this template is to provide a standard format for labeling links to official websites.

Tham số bản mẫu

Tham sốMiêu tảKiểuTrạng thái
url1 url URL

The url that the template will link to. This is required unless the URL is available from Wikidata.

Mặc định
Wikidata property P856
Ví dụ
https://example.com
URLtùy chọn
Textname

The text the URL will display. This should usually be left to the default. However, this parameter may be provided when there is another webpage that could reasonably understood as the official website and needs to be distinguished from this link.

Mặc định
Official website
Ví dụ
Publisher's website
Chuỗi dàitùy chọn
Mobile Websitemobile

If the website has a different 'official website' for mobile devices this website can be listed here

Ví dụ
https://m.example.com
Chuỗi dàitùy chọn
Requires Flashformat

If the website requires Adobe Flash Player software to be displayed, set this parameters value to 'flash'

Ví dụ
flash
Chuỗi dàitùy chọn

Thể loại theo dõi[sửa mã nguồn]

Một trong những thể loại sau đây có thể được thêm vào các bài viết sử dụng bản mẫu này (thông qua Mô đun:Official website):

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