Please remember to follow the manual of style and code of conduct at all times.
Check BNN and Bulbanews for up-to-date Pokémon news and discuss it on the forums or in our IRC channel #bulbagarden on

Template talk:!

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to: navigation, search


What is the point of this template? Chocolate((Talk to Me|Look at My Contributions)) 22:52, 7 December 2008 (UTC)

"This template is to be used inside other templates to add the pipe sign to the arguments since the pipe sign itself is the argument separator." See for example the sandbox section which demonstrates this. UltimateSephiroth (about me · chat · edits) 22:55, 7 December 2008 (UTC)
I still don't get it. Chocolate((Talk to Me|Look at My Contributions)) 22:56, 7 December 2008 (UTC)
Look, you cannot enter a "|" character into any of those text clips you give to a template. But if you put a {{!}} instead, you can do that. In that example we use the Ani template, which doesn't give an option to define the image size. But by using this we can put the image name there, then put a pipe, define the size and let the automatically added ".png" roll into another argument by adding another pipe. A better example of this would be when we have to add a table via template. UltimateSephiroth (about me · chat · edits) 23:03, 7 December 2008 (UTC)
I still don't get it... Chocolate((Talk to Me|Look at My Contributions)) 22:30, 8 December 2008 (UTC)
Bump. Chocolate (Chat with Me) 01:48, 27 December 2008 (UTC)
Well, since you're so adamant you're gonna get this question prevents glitches in table code. If you just use | rather than {{!}}, it's likely to cause something to show incorrectly. For example, if I had this coding:
{{#if:{{{text|}}} | style="padding-left:50px;text-align:justify" | {{{text}}}}}
It wouldn't simply show {{{text}}} as I wanted it to. It would show:
"style="padding-left:50px;text-align:justify" | {{{text}}}
...Because that text comes after the first vertical pipe. Whatever comes after the first vertical pipe gets displayed on the page. Now I'm going to use this coding:</nowiki>
{{#if:{{{text|}}} {{!}} style="padding-left:50px;text-align:justify" {{!}} {{{text}}}}}
See? Now there are no vertical pipes in the template itself. Because of this, the template can read everything separately. This means that only {{{text}}} will show on the template. The style won't show because it'll have been implemented.
Answer your question? Merry Christmas from Cipher (Talk) 21:23, 27 December 2008 (UTC)
I still don't understand the difference... Chocolate (Chat with Me) 22:02, 27 December 2008 (UTC)
If you actually use a | inside a template, say as a simple divider, the wiki software thinks it's a part of the coding instead and normally the result messes up the entire template. By using this template to insert the | symbol, you still get a |, but without messing up the code. -- Jïörüjï Ðērākō.>.cнаt^ 01:34, 28 December 2008 (UTC)

(resetting indent) I still don't get it... Chocolate (Chat with Me) 01:37, 28 December 2008 (UTC)

It might be easier if you found a template that uses this template, then replaced the {{!}} with | instead. Make sure to just use show preview, not actually save, you'll probably see that the template code breaks. -- Jïörüjï Ðērākō.>.cнаt^ 01:40, 28 December 2008 (UTC)
Okay, I see. But why does it happen? Chocolate (Chat with Me) 01:45, 28 December 2008 (UTC)
In a template, the pipe sign is used to seperate variables. In anything else, it's used differently (such as in a table, where you'd use |- to make a new line). In that particular instance, using a | in the template makes it think you're setting new variables, even though there's only one (the "what's the name of the image?" variable). using the {{!}} instead doesn't have that effect, since it sees it as part of the "what's the name of the image?" question instead, so it actually uses the pipe sign.
...if that makes it any more understandable. -- Jïörüjï Ðērākō.>.cнаt^ 01:52, 28 December 2008 (UTC)
I'm still confused... Chocolate (Chat with Me) 01:54, 28 December 2008 (UTC)
Here, I found myself in a predicament today for this reason (not on this wiki). The pipe character ( | ) is used in pretty much any template. Take template:P for example: to link to Sandshrew (Pokémon), you need to use Sandshrew with a pipe in it. When moving to the next column in a table, you also use a pipe. When using a template in a table, however, the wiki coding doesn't recognize that the pipe is meant for the template, and thinks it's to advance the table. Because of this, it screws up your template coding. Using | to the wiki coding is the same as using a pipe for the template, however it's not the same when the code tries to format the table. Therefore, it doesn't screw up your coding. Hope this helps! ←{Berrymaster|Talk|Contrib}→ 02:00, 28 December 2008 (UTC)
I still don't get it... Chocolate (Chat with Me) 02:01, 28 December 2008 (UTC)
*sigh* All you need to know is that it prevents wiki coding from screwing up. ←{Berrymaster|Talk|Contrib}→ 02:03, 28 December 2008 (UTC)

(resetting indent) But I don't understand why the wiki code screws up at all. Chocolate (Chat with Me) 02:04, 28 December 2008 (UTC)

I think you're better off studying up on how Templates work, then. It's hard to explain any further. -- Jïörüjï Ðērākō.>.cнаt^ 02:07, 28 December 2008 (UTC)