Forum:Weird spacing/linebreak in infobox

ShoutWiki — express yourself and be heard!
Jump to navigation Jump to search

Forums: Index Community help

Hello. I've just created an "Armed faction" template for my wiki based on the Person template documented in the Help:Infoboxes page. Here is the template: link

Note that I haven't uploaded any images to my wiki yet, so the image link will always be broken.

For the most part, I'm satisfied with it, but there's something odd going on with regard to the amount of vertical space I sometimes get. Take a look at 1st Infantry Brigade: You can see that in the "Part of" section, the template gives space for two or even three lines of text, when there's only one. After some experimenting, I've determined that a given field will only have this extra spacing if the next two fields are blank. In this case, I left "precededby" and "succeededby" blank. If I fill one or both of them in, the problem with "partof" goes away. Does anyone know if I can fix this? Thanks for your time. Bulbajer (talk) 22:40, 8 September 2020 (UTC)

With the new row creator → {{!}}- → inside the ifs, it seems to create rows even when empty.
I have slotted {{!}}- between the ifs and seems to hide unused rows
{| style="border: 1px solid #aaa; border-spacing: 0; float: right; margin: 0 0 .5em 1em; width: 300px;"
| style="background-color: {{{bgcolor|Beige}}}; text-align: center;" |
 <p style="font-size: larger;">'''{{{name|{{PAGENAME}}}}}'''</p>
 <div style="background-color: #fff; margin: 0 25px;">[[File:{{{image}}}|250px|link=]]</div>
 <p>{{{caption}}}</p>
|-
| style="text-align: center;" | <u>'''Details'''</u>
{| style="margin: 0 auto; text-align: left;"
{{#if:{{{active|}}}|
! style="text-align: right; width: 80px;" {{!}} Active:
{{!}} {{{active}}} }}
{{!}}-
{{#if:{{{area|}}}|
! style="text-align: right;" {{!}} Area:
{{!}} {{{area}}} }}
{{!}}-
{{#if:{{{ideology|}}}|
! style="text-align: right;" {{!}} Ideology:
{{!}} {{{ideology}}} }}
{{!}}-
{{#if:{{{partof|}}}|
! style="text-align: right;" {{!}} Part of:
{{!}} {{{partof}}} }}
{{!}}-
{{#if:{{{precededby|}}}|
! style="text-align: right;" {{!}} Predecessor:
{{!}} {{{precededby}}} }}
{{!}}-
{{#if:{{{succeededby|}}}|
! style="text-align: right;" {{!}} Successor:
{{!}} {{{succeededby}}} }}
{{!}}-
{{#if:{{{status|}}}|
! style="text-align: right;" {{!}} Status:
{{!}} {{{status}}} }}
|}
|}

-Percy (talk) 15:34, 10 September 2020 (UTC)

This worked! Thank you so much! Bulbajer (talk) 16:36, 10 September 2020 (UTC)