Wikipedia:Articles for creation
Why am I confused?
At WP:VPT §Is it possible to resolve a redirect in template? you wrote:
- ...
[[{{#invoke:redirect|main|WP:AFC}}]]
gets you Wikipedia:Articles for creation ...
So I visited Module:Redirect and found this:
---- This module accepts the name of a single page. It determines if the page is a redirect; if so it looks up the page, extracts the target, and returns the target name as text.
So, why, he asks, are there two parameters? In the example you gave both main
and WP:AFC
. I tried your module with the redirect page from the WT:VPT conversation:
[[{{#invoke:redirect|RNAS_Kirkwall|WP:AFC}}]]
→ [[Script error: The function "RNAS_Kirkwall" does not exist.]]
[[{{#invoke:redirect|main|RNAS_Kirkwall}}]]
→ Kirkwall Airport
Why are two parameters necessary? And, surely there is a better error message than Script error.
—Trappist the monk (talk) 17:12, 18 March 2013 (UTC)
- It occurred to me to also wonder if the first parameter could be empty:
[[{{#invoke:redirect||RNAS_Kirkwall}}]]
→ [[Script error: The function "" does not exist.]]
- Apparently not. So what about meaningless text?
[[{{#invoke:redirect|sdjadrsgjlk|RNAS_Kirkwall}}]]
→ [[Script error: The function "sdjadrsgjlk" does not exist.]]
- Again, apparently not. So what about the name of a real article?
[[{{#invoke:redirect|UP Aerospace|RNAS_Kirkwall}}]]
→ [[Script error: The function "UP Aerospace" does not exist.]]
- Nope. Is "main" some sort of secret word?
- {{#invoke:}} takes two parameters: the first is the module name (redirect in this case), the second the function to use from that module (main in this case, as specified by the line "
function p.main(frame)
" in the module). So the third parameter given to #invoke is the first parameter given to the function. In that way modules can make more than one functions available. - To get more information on the script error, you have click it. MrBlueSky (talk) 14:40, 19 March 2013 (UTC)
- {{#invoke:}} takes two parameters: the first is the module name (redirect in this case), the second the function to use from that module (main in this case, as specified by the line "
- Thank you. I've learned a bit here.
- Thanks for answering that! I've gotten used to using these module talk pages for anything but talking, and this is the first I noticed the conversation... Wnt (talk) 20:44, 19 March 2013 (UTC)