سانچہ:URL2
![]() | اس سانچے میں حسب ذیل لوا ماڈیول زیر استعمال ہے: |
This is a fork of Template:URL for use in infoboxes.
It behaves similarly to {{URL}} with the following exceptions:
- By default it does not display anything if the parameters are blank or omitted. Template:URL displays
{{URL|example.com|optional display text}}
by default. - It implements a parameter
|msg=
that turns on or off the message{{URL|example.com|optional display text}}
. Setting msg to false or anything beginning with n or N will suppress the message. Anything else enables the message. - It strips html tags and wiki-link markup from the supplied url parameter.
- It truncates the url parameter at the first space it finds.
- It can take its own output as input, allowing website parameters to be wrapped in
{{URL2}}
in the design of an infobox, without causing problems if editors add|website={{URL|some.url.com}}
in an article.
Usage
[ترمیم]{{URL2|url}}
{{URL2|1=url}}
Examples
[ترمیم]Different from Template:URL
[ترمیم]If there is no input, the default behavior of URL2 is to display nothing (use |msg=
to display the instructional message):
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
URL2 handles formatting commonly found in the |website=
parameter of an infobox:
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
Same as Template:URL
[ترمیم]The template wraps the output in <span>...</span>
(see § Microformat) and adds <wbr/> before displayed periods:
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
The use of http://, https://, a protocol-relative URL, or a different protocol is preserved in the URL but is not shown in the link text:
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
If the path is only a slash (/
) it is not displayed in the link text:
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
The template also adds <wbr/> before any displayed slashes (/
) in the path:
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
For a URL containing an equal sign (=
), use |1=
:
{{URL2}}
{{URL2/sandbox}}
Error: expandTemplate: template "URL2/sandbox" does not exist
Microformat
[ترمیم]The template wraps the displayed URL with class="url"
so that it is included in any parent microformat which takes a URL parameter - see Wikipedia:WikiProject Microformats.
اوپر دی گئی دستاویز صفحہ سانچہ:URL2/دستاویز سے شامل کی گئی ہے۔ (ترمیم | تاریخچہ) صارفین سانچہ کے تختہ مشق (تخلیق | آئینہ) اور ثابتات (تخلیق) میں تجربات کرسکتے ہیں۔ براہ کرم /دستاویز کے ذیلی صفحہ پر زمرہ جات شامل فرمائیں۔ اس سانچہ کے ذیلی صفحات۔ |