Пређи на садржај

Шаблон:Zvanični veb-sajt-lat/док

Iz Vojne Enciklopedije

{{#ifeq:док |док

    | 

{{#ifeq:show |show

|

        }}{{#if: |
         |   {{#ifexist:Шаблон:Zvanični veb-sajt-lat
                  | [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
                  | 
                 }}
        }}
    | 
   }}

{{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Шаблон|Шаблон 
   | template 
   | other 
   }}
 }}

| template | шаблон

| šablon =

| other | #default = }}

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

Usage

Basic usage

{{#switch:док

|sandbox |testcases |doc= |#default=

}}

{{#switch:док

 |sandbox |testcases |doc= 
 |#default = {{#switch:
 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Шаблон|Шаблон 
   | template 
   | other 
   }}
 }}

| template | шаблон | šablon =

| other | #default = {{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Шаблон|Модул
   | module
   | other
   }}
 }}

| module =

| other | #default = {{#switch:

 {{#if:
 | {{{demospace}}}    
 | {{#ifeq:Шаблон|Категорија
   | category
   | other
   }}
 }}

| category =

| other | #default =

}}

}}

}}

 }}

This template can be used without specifying any parameters, if the "official website" Property (P856) is set in the respective article's Wikidata record. Just add {{{{#if: |замени:}}official website{{#if: ||{{{2}}}}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}} to the article's External weblinks section. If on Wikidata more than one official website is given, the entry tagged with the language being English is automatically preferred.

Advanced usage

Four parameters are available:

Some URLs that contain special characters, such as & or =, will break the template. The solution is to prepend the URL with 1=

Code Result
{{Zvanični veb-sajt}} Zvanični veb-sajt (URL must be on Wikidata)
{{Zvanični veb-sajt|example.org}} Zvanični veb-sajt
{{Zvanični veb-sajt|www.example.org}} Zvanični veb-sajt
{{Zvanični veb-sajt|//www.example.org}} Zvanični veb-sajt
{{Zvanični veb-sajt|http://www.example.org/}} Zvanični veb-sajt
{{Zvanični veb-sajt|https://www.example.org/}} Zvanični veb-sajt
{{Zvanični veb-sajt|1=http://www.example.org/?action=view}} Zvanični veb-sajt
{{Zvanični veb-sajt|http://www.example.org|name=Primer}} Primer
{{Zvanični veb-sajt|example.org|mobile=http://m.example.org}} Zvanični veb-sajt (mobilni)
{{Zvanični veb-sajt|example.org|format=flash}} Zvanični veb-sajt (neophodan Adobe Flash Player){{#if:|{{#ifeq:{{ safesubst:#if: {{{1}}}|Шаблон:Zvanični veb-sajt-lat/док}}|1}} {{{1}}}|Шаблон:Zvanični veb-sajt-lat/док}}

}}|Wikipedia:Template messages||{{#ifexpr:{{#if:Шаблон|0|1}}+{{#ifeq:yes|yes|0|1}}

{{#if: {{#ifexist:Категорија: from }} [[Категорија:{{#if: }}]]}}{{#if: [[Категорија:]]}}}}}}}}

TemplateData

{{#if:|погледајте месечни извештај о грешкама за овај шаблон.|Ово је {{#if:|TemplateData|TemplateData}} документација за овај шаблон, коришћена у Визуелном уређивачу и у другим алаткама; погледајте месечни извештај о грешкама за овај шаблон.}}

TemplateData за Zvanični veb-sajt-lat

{{#ifeq:док|sandbox||

}} <TemplateData> {

       "description": "The purpose of this template is to provide a standard format for labeling links to official websites.",
       "params": {

"1": {

                       "label": "URL",
                       "aliases": ["URL"],
                       "description": "The URL that the template will link to",
                       "type": "string",
                       "required": false
               },
               "name": {
                       "label": "URL Text",
                       "description": "The text the URL will display. If not provided this will default to 'Official website",
                       "type": "string",
                       "required": false
               },

"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
               },

"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
               }
       }

} </TemplateData>

See also