Forums: Index → Support Requests → Need help figuring out a template/parser function problem
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
To contact staff directly or to report bugs, please use Special:Contact.
I spent a couple of hours today trying to make this template automatically create links for parameters 1, 2, and 3. I couldn't find anything that said you can't put [[ and ]] inside the {{#if}} function, but it always output something that looked like this:
- [[Hart Hills
]]
- [[Hawklor
]]
instead of:
- Hart Hills
- Hawklor
The only explanation I could think of was that it's somehow including a line break as part of the parameters. If so, why? Or is there something else I'm missing? Thanks! Psychoadept (talk) 06:28, August 1, 2012 (UTC)
- I don't understand what the problem is?
{{#if:1|*[[Hart Hills]] **[[Hawklor]]}}
- makes
- Hart Hills
- Hawklor
- which looks fine to me. Is what you're trying to do different / more complex than this? If so, please post the exact snippet of code that you tried (not the entire template code -- just the small part that's causing the problem). Mathmagician ƒ(♫) 06:43 UTC, Wed, 01 August 2012
- Here's the code in question (the first layer of the list is a required parameter, included just prior to this):
{{#if:{{{1|}}}|** {{{1}}} }} {{#if:{{{2|}}}|*** {{{2}}} }} {{#if:{{{3|}}}|**** {{{3}}} }}
- What I tried that didn't work was this:
{{#if:{{{1|}}}|** [[{{{1}}}]] }} {{#if:{{{2|}}}|*** [[{{{2}}}]] }} {{#if:{{{3|}}}|**** [[{{{3}}}]] }}
- Psychoadept (talk) 07:12, August 1, 2012 (UTC)
- Sorry, just to verify, can you also link me to a page that uses this template where it's not working properly? As far as I can tell, your template appears to be working just fine. For example, on your w:c:sryth:Westwold page, I am seeing this.
- Edit: I've finished doing a bit more tinkering now. Check out http://mathmagician.wikia.com/wiki/Template:Test2?oldid=5375 and http://mathmagician.wikia.com/wiki/Template:Test3?oldid=5377, these might be able to help you figure out the linebreak issue. In particular, my Test3 template makes use of wikipedia:Template:Trim, which is used for trimming whitespace in templates. Mathmagician ƒ(♫) 08:02 UTC, Wed, 01 August 2012