Wikia

Community Central

Template code question

89,733pages on
this wiki

Forum page

This Forum has been archived

Visit the new Forums
Forums: Index Help desk Template code question
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 2612 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

Just a quick question about the code. What's the difference beviene {{{1}}} and {{{1|}}}. I can't seem to find enough info about how to build templates. Is it just me, or is it hidden somewhere? --Steinninn 06:41, 23 May 2007 (UTC)

Somewhere in m:Help:Advanced templates. But the gist is that the second has a default value. Anything after the | is a default value. So if we called a template that had {{{1|a}}} in it, and we gave it the first parameter b then we would see b. But if we didn't pass any variable 1, then we'd see a. If we used {{{1}}} and we passed b we would see b, but if we didn't pass a parameter 1, then we would see {{{1}}}. The difference between {{{1}}} and {{{1|}}} is that the second one shows up as nothing when we don't pass anything to the variable. That's why we use {{{1|}}} in parserfunctions. Because if we used {{#if:{{{1}}}|true|false}} and we didn't send any parameters to the template, that would still say true. It would stay true unless we used something like {{template|}}. ~Dantman(talk) tricks May 23, 2007 @ 07:08 (UTC)

Aha, I think I understand. I had to read it trough a few times before I understood it. All exepte the last part. But I didn't even ask about it. I'll try and read trough the "advanced templates" and figure it out there. Thanks for the link. And the explanation. I'll try to remember it next time I'm building something. --Steinninn 07:19, 23 May 2007 (UTC)

Around Wikia's network

Random Wiki