Template talk:Infobox City
Jump to navigation
Jump to search
I built this city template (on rock 'n roll... ack, no Starship... and besides, I mostly stole it from Wikipedia), and it looks fine when I test it on normal test pages (and on the San Francisco page), but in the tplist template it comes out will all kinds of blank space. Anyone know what I did wrong? --Falcotron 05:39, 17 August 2006 (UTC)
- OK, after much trial-and-error, I think I may have fixed it. The problem was that there were carriage returns between the #ifs, so when they were empty, they were piling up, and I guess a couple carriage returns means "add a blank line" in wiki formatting. The problem with taking the carriage returns out between the #ifs is that you need carriage returns between the rows of the table... but if you put them back in within the "then" portion of the #ifs, they get stripped out automatically, because all whitespace at the beginning and end of the "then" portion gets stripped. So it turns out that you need to throw in something to distinguish the carriage return from ordinary whitespace, like an empty <nowiki/> tag. Anyway, the template looks like crap now, but seems to work OK on the San Francisco and template list pages. I learned a lot. Jclee 02:42, 24 August 2006 (UTC)
- Weird how the raw template now shows up as {{{city_name}}} instead of blank space--but it seems to work when you actually use it and in the tplist, as promised. So thanks! --Falcotron 20:18, 24 August 2006 (UTC)
- I think that's because I took out the vertical bar in {{{city_name|}}}, which causes it to default to blank if the variable is empty. I figured it wouldn't matter, since there should always be a city name, and it serves as documentation of the template when the city name is missing; otherwise, you just see empty boxes. --Jclee 14:59, 26 August 2006 (UTC)
- Weird how the raw template now shows up as {{{city_name}}} instead of blank space--but it seems to work when you actually use it and in the tplist, as promised. So thanks! --Falcotron 20:18, 24 August 2006 (UTC)