Forgotten Realms Wiki
Advertisement
Forgotten Realms Wiki
Forums: Helping Hand > Crazy problem with location template

Use the following template for a nicely presented post:

{{Forum post|Write your message here!|~~~~}}

I must be going crazy, but there's a very strange problem on the {{Location}} template, in the geographical information section.

If you use this template, and supply only one parameter from that section such as area or capital, a mysterious <p><br></p> appears inside the geographical information heading.

If you supply only the size parameter, the mysterious <p><br></p> is now inside the value of the size parameter.

If you supply only the aliases parameter, or supply multiple parameters, things look as they should. I have tried everything I can think of to fix this problem but I can't see anything wrong with the template, let alone anything that would cause behaviour as strange as is happening here. If anyone thinks they can fix this problem, it would be a huge help.

Fw190a8 00:03, October 30, 2010 (UTC)
The only thing I can think of is that it has something to do with the carriage returns between #if statements. Obviously, there aren't any <p /> or <p></p> statements in there, so the software is picking up on extra space and interpreting it as separate paragraphs. This is likely unrelated, but there are an awful lot of unnecessary |s in that template. For #if statements where there is no else option, its not necessary to put a | at the end of the then part.
Cronje 00:19, October 30, 2010 (UTC)
I'm a little disappointed that the template syntax is so incredibly complicated and difficult to debug. We have what would otherwise be a great {{Location}} template, but it is being ruined by some illogical and, to me, nonsensical processing. See Border Kingdoms for an example. Where are these extra paragraph tags coming from, and why does the "capital" take up so much vertical space? I can't even add an "area" parameter because it breaks the entire template, but no matter what combination of whitespace I try, it does nothing at all, let alone fix the issue.

Since these templates are used on so many articles, I fear we might be held back or at least severely hampered until we can come up with a solution to this.

Fw190a8 15:39, November 14, 2010 (UTC)
I'm going to copy and paste the current template into a sandbox and fiddle with. With some luck (damn wiki code!) I'll figure it out soon enough.
Cronje (talkcontribs) 01:29, November 15, 2010 (UTC)
This might take longer than I thought. I just realized that the template uses nested tables and that neither table has the closing table code ( |} ), making it difficult to determine where one table ends and the other continues.
Cronje (talkcontribs) 02:05, November 15, 2010 (UTC)
I think I might have it working correctly, but don't want to overwrite the previous works until other editors have had a chance to test it. It seems to work okay with the Border Kingdoms, at least. User:Cronje/Template:Location
Cronje (talkcontribs) 02:43, November 15, 2010 (UTC)
Advertisement