Bước tới nội dung

Khác biệt giữa bản sửa đổi của “Bản mẫu:Website chính thức/doc”

Bách khoa toàn thư mở Wikipedia
Nội dung được xóa Nội dung được thêm vào
MerlIwBot (thảo luận | đóng góp)
n Bot: Thêm sw:Kigezo:Official
nKhông có tóm lược sửa đổi
Thẻ: Trình soạn thảo mã nguồn 2017
 
(Không hiển thị 17 phiên bản của 7 người dùng ở giữa)
Dòng 1: Dòng 1:
{{Trang con tài liệu}}
{{Documentation subpage}}
{{tsh|oweb|official}}
{{Lua|Mô đun:Official website|Mô đun:Check for unknown parameters}}
{{sử dụng Wikidata|P856}}
{{theo dõi Wikidata|P856}}

==Cách sử dụng==


=== Sử dụng ===
=== Sử dụng ===
Dùng bản mẫu này để liên kết đến các trang web 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 "Trang web chính thức" không phù hợp), ta có thể dùng thêm tham số {{para|name}}
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ố {{thông số|name}}

Nếu một số URL chứa các kí tự đặc biệt như <code>&</code> hay <code>=</code>, 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 {{thông số|url}} hoặc đơn giản hơn, {{thông số|1}}.

== Các ví dụ ==
=== URL trên bản mẫu ===
Ở 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ẻ {{tag|span}}.
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|example.org}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|www.example.org}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|//www.example.org}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|http://www.example.org}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|https://www.example.org}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|1=https://example.org/?action=view}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|https://example.org|name=Ví dụ}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|https://example.org|mobile=https://m.example.org}}</nowiki>}}
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức|https://example.org|format=flash}}</nowiki>}}

=== URL trên Wikidata ===
Cách sử dụng trong bài viết [[Amazon (công ty)]]:''
* <code><nowiki>{{website chính thức}}</nowiki></code> → {{website chính thức|https://www.amazon.com}} [[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]]<pre style="white-space: pre-wrap;"><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]]</pre>

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 ===
Nếu một số URL chứa các kí tự đặc biệt như <code>&</code> hay <code>=</code>, 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 {{para|url}} hoặc đơn giản hơn, {{para|1}}.
Sử dụng trên bất kỳ trang nào không có URL trên thuộc tính Wikidata {{Property|P856}}:
{{nowiki template demo|format=inline|output=nowiki+|code=<nowiki>{{website chính thức}}</nowiki>}}


== Dữ liệu bản mẫu ==
===Ví dụ===
{{đầu đề dữ liệu bản mẫu}}
{|class="wikitable"
<templatedata>
|-
{
! Mã !! Kết quả
"description": "The purpose of this template is to provide a standard format for labeling links to official websites.",
|-
"params": {
| <code><nowiki>{{Trang web chính thức|example.org}}</nowiki></code>
"1": {
| {{Trang web chính thức|example.org/}}
"label": "url",
|-
"aliases": [
| <code><nowiki>{{Trang web chính thức|www.example.org}}</nowiki></code>
"url",
| {{Trang web chính thức|www.example.org/}}
"URL"
|-
],
| <code><nowiki>{{Trang web chính thức|http://www.example.org}}</nowiki></code>
"description": "The url that the template will link to. This is required unless the URL is available from Wikidata.",
| {{Trang web chính thức|http://www.example.org/}}
"type": "url",
|-
"required": false,
| <code><nowiki>{{Trang web chính thức|https://www.example.org}}</nowiki></code>
"default": "Wikidata property P856",
| {{Trang web chính thức|https://www.example.org/}}
"example": "https://example.com"
|-
},
| <code><nowiki>{{Trang web chính thức|url=http://www.example.org/?action=view}}</nowiki></code>
"name": {
| {{Trang web chính thức|url=www.example.org/?action=view}}
"label": "Text",
|-
"description": "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.",
| <code><nowiki>{{Trang web chính thức|http://www.example.org|name=Website Ví dụ chính thức}}</nowiki></code>
"type": "string",
| {{Trang web chính thức|http://www.example.org/|name=Website Ví dụ chính thức}}
"required": false,
|}
"example": "Publisher's website",
"default": "Official website"
},
"mobile": {
"label": "Mobile Website",
"description": "If the website has a different 'official website' for mobile devices this website can be listed here",
"type": "string",
"required": false,
"example": "https://m.example.com"
},
"format": {
"label": "Requires Flash",
"description": "If the website requires Adobe Flash Player software to be displayed, set this parameters value to 'flash'",
"type": "string",
"required": false,
"example": "flash"
}
}
}
</templatedata>


== Thể loại theo dõi ==
===Đổi hướng===
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]]):
*{{tl|Official}}
* {{clc|Website chính thức khác nhau giữa Wikidata và Wikipedia}}
* {{clc|Website chính thức không có trên Wikidata}}
* {{clc|Website chính thức thiếu URL}}
* {{clc|Trang sử dụng website chính thức có các tham số không rõ}}


== Xem thêm ==
<includeonly>
* {{Tl|Official URL}} – For automatically inserting the official website Wikidata property
[[Thể loại:Bản mẫu liên kết ngoài|{{PAGENAME}}]]
* {{Tl|URL}} – For use instead of {{Tl|Website chính thức}} in infoboxes


<includeonly>{{sandbox other||
[[az:Şablon:Rəsmi saytı]]
<!-- Categories below this line; interwikis at Wikidata -->
[[ca:Plantilla:Oficial]]
[[Thể loại:Bản mẫu liên kết ngoài sử dụng Wikidata]]
[[en:Template:Official website]]
[[Thể loại:Bản mẫu thêm một thể loại theo dõi]]
[[es:Plantilla:Web oficial]]
}}</includeonly>
[[fa:الگو:وب‌گاه رسمی]]
[[fr:Modèle:Site officiel]]
[[hy:Կաղապար:Պաշտոնական կայք]]
[[ar:قالب:موقع رسمي]]
[[id:Templat:Official]]
[[sw:Kigezo:Official]]
[[mk:Шаблон:Официјална]]
[[arz:قالب:Official website]]
[[ja:Template:Official]]
[[gu:ઢાંચો:અધિકૃત જાળસ્થળ]]
[[ko:틀:공식 웹사이트]]
[[pt:Predefinição:Oficial]]
[[ru:Шаблон:Официальный сайт]]
[[sco:Template:Offeecial wabsteid]]
[[simple:Template:Official]]
[[uk:Шаблон:Official]]
[[ur:سانچہ:سرکاری موقع حبالہ]]
[[sl:Predloga:Official website]]
[[sv:Mall:Officiell webbplats]]
[[tr:Şablon:Resmî site]]
[[ml:ഫലകം:ഔദ്യോഗിക_വെബ്സൈറ്റ്]]
</includeonly><noinclude>
[[en:Template:Official website/doc]]
[[gu:ઢાંચો:અધિકૃત જાળસ્થળ/doc]]
[[ko:틀:공식 웹사이트/설명문서]]
[[kn:ಟೆಂಪ್ಲೇಟು:Official website/doc]]
[[ka:თარგი:ოფიციალური/ინფო]]
[[arz:قالب:Official website/doc]]
[[pap:Template:Official website/doc]]
[[sa:फलकम्:Official/doc]]
</noinclude>

Bản mới nhất lúc 18:59, ngày 30 tháng 7 năm 2024

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):