:Talkspace detect/설명문서

위키백과, 우리 모두의 백과사전.

{{talkspace detect}} 메타틀(meta-template)이다.

다른 틀들로 하여금 그 틀이 위치한 페이지의 속성을 감지하도록 한다. 위키백과에서 사용되는 토론 이름공간들을 몇 개의 종류로 구분한다.

main = 일반 문서의 토론에 이 틀이 위치한 경우의 출력을 정의한다.
user, wikipedia, file, mediawiki, template, help, category, portal, book, draft and module = 해당 이름공간의 토론에 이 틀이 위치한 경우 의 출력을 정의한다.
default = 특별히 정의되지 않은 토론공간에 있는 경우의 출력을 정의한다.
other = 토론공간이 아닌 다른 곳에 있는 경우의 출력을 정의한다.

Usage[편집]

This template takes one or more parameters named after the different page types as listed above. Like this:

{{talkspace detect
| main    = Article talk page text
| user    = User talk page text
| default = Text for all other talkspaces
| other   = Text for all subject spaces
}}

By using an empty parameter you can make it so this template doesn't render anything for some specific page type. Like this:

{{talkspace detect
| main    = 
| default = Text for all other talkspaces
}}

The "page" parameter[편집]

For testing and demonstration purposes this template can take a parameter named page. Like this:

{{talkspace detect
| user = User talk text.
| default = Any talk page text.
| page = User talk:Example
}}

No matter on what kind of page the code above is used it will return this:

User talk text.

The page parameter makes this template behave exactly as if on that page. The pagename doesn't have to be an existing page.

If the page parameter is empty or undefined, the name of the current page determines the result.

You can make it so your template also understands the page parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:

{{talkspace detect
| user = User talk text.
| default = Any talk page text.
| page = {{{page|}}}
}}


틀:Namespace and pagename-detecting templates