Community Central
Community Central
No edit summary
No edit summary
Line 56: Line 56:
 
:::: Okay, I imported [[wikipedia:Template:Trim]] and it's working, but the <nowiki>[[ and ]]</nowiki> are still rendering as text instead of creating a link. As far as I can tell I've copied your code exactly. [[User:Psychoadept|Psychoadept]] ([[User talk:Psychoadept|talk]]) 15:10, August 1, 2012 (UTC)
 
:::: Okay, I imported [[wikipedia:Template:Trim]] and it's working, but the <nowiki>[[ and ]]</nowiki> are still rendering as text instead of creating a link. As far as I can tell I've copied your code exactly. [[User:Psychoadept|Psychoadept]] ([[User talk:Psychoadept|talk]]) 15:10, August 1, 2012 (UTC)
   
:::::[http://sryth.wikia.com/index.php?title=Template%3ATrim&diff=34987&oldid=34977 Fixed] {{User:Mathmagician/sig|16:11 UTC|Wed|01 August 2012}}
+
:::::[http://sryth.wikia.com/index.php?title=Template%3ATrim&diff=34987&oldid=34977 Fixed Trim], also [http://sryth.wikia.com/index.php?title=Template%3AMapDirections&diff=34986&oldid=34985 this edit] was mine but I forgot to login. Everything seems to be working now? {{User:Mathmagician/sig|16:11 UTC|Wed|01 August 2012}}

Revision as of 16:14, 1 August 2012

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.
Archive
Note: This topic has been unedited for 4279 days. It is considered archived - the discussion is over. Information in this thread may be out of date. Do not add to unless it really needs a response.


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). 20px_Rin_Tohsaka_Avatar.png 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)
Syrth Westwold
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. 20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 08:02 UTC, Wed, 01 August 2012
Fantastic, thanks! That trim template is exactly what I needed. For organizational clarity, it's best if I can keep the separate lines. Psychoadept (talk) 14:58, August 1, 2012 (UTC)
Okay, I imported wikipedia:Template:Trim and it's working, but the [[ and ]] are still rendering as text instead of creating a link. As far as I can tell I've copied your code exactly. Psychoadept (talk) 15:10, August 1, 2012 (UTC)
Fixed Trim, also this edit was mine but I forgot to login. Everything seems to be working now? 20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 16:11 UTC, Wed, 01 August 2012