Jump to content

Template:Pi zero/context/button/delta

From Wikinews, the free news source you can write!

( ( ) ( ) )

[edit] Template documentation

Usage

[edit]

This subtemplate of {{User:Pi zero/context/button}} computes dialog parameter context-delta to be passed through the button. Unnamed template parameters passed to this template name dialog parameters to be whitelisted; template parameter template passed here names a template to be informed.

Examples

[edit]

The result list-of-lists starts with a list of allowed parameters, then a list of disallowed parameters, then one or more lists naming a template followed by the names of parameters it requests.

code

{{Template:Pi zero/context/button/delta|template=User:Pi zero/context/test/a|a|b|c}}

output

( ( "a" "b" "c" ) ( ) ( "User:Pi zero/context/test/a" ) )

code

{{Template:Pi zero/context/button/delta|a|b|c}}

output

( ( "a" "b" "c" ) ( ) )

code

{{Template:Pi zero/context/button/delta|template=User:Pi zero/context/test/b}}

output

( ( ) ( ) ( "User:Pi zero/context/test/b" ) )

code

{{Template:Pi zero/context/button/delta|template=User:Pi zero/context/test/c}}

output

( ( ) ( ) ( "User:Pi zero/context/test/c" ) )

Internals

[edit]

This template calls {{evalx}} using Module:TScope#prepend; the wikilisp code to be executed thus becomes the first unnamed parameter to {{evalx}}, while the unnamed parameters passed to the parent template become later unnamed parameters to {{evalx}}. If a template parameter is passed to this template, a query to template subtemplate /context-requests is also passed to {{evalx}} under parameter name context-delta.