Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexpected Line Break in MediaWiki Template
    primarykey
    data
    text
    <p>So I have a MediaWiki template which I use within a table to represent one column. The code looks like this and works as I want it.</p> <pre>&ltincludeonly&gt{{#if:{{{name|}}}|''{{{name}}}: ''|}}{{#if:{{{food|}}}|+{{Food|{{{food|}}}}}|}} {{#if:{{{condition|}}}|{{{condition|}}}|}}&lt/includeonly&gt</pre> <p>When I use it with the input</p> <pre> {{Symbiosis|name=Groove|food=10|condition=if next to [[Apple Tree]], [[Dandelion]] or [[Straberry]]}} </pre> <p>I get the folling result which is as desired.</p> <p><img src="https://i.stack.imgur.com/2Gel5.png" alt="correct output"></p> <p>However now I want to extend this template and move the part with the <code>food</code> definition in another template because I need it elsewhere again. So I make a new <code>ResourceList</code> template which basically does the same as before.</p> <pre>&ltincludeonly&gt{{#if:{{{food|}}}|+{{Food|{{{food|}}}}}|}}&ltincludeonly&gt</pre> <p>and include it in my <code>Symbiosis</code> template to look like this.</p> <pre>&ltincludeonly&gt{{#if:{{{name|}}}|''{{{name}}}: ''|}}{{ResourceList|food={{{food}}}}} {{#if:{{{condition|}}}|{{{condition|}}}|}}&lt/includeonly&gt</pre> <p>But when I now use the same input as above I get a line break in my table to look like this. <img src="https://i.stack.imgur.com/1XtoI.png" alt="wrong output"></p> <p>Why is this? There are no spaces or linkebreaks in the template definitions. I don't really understand how MediaWiki handles all this, it is quite confusing and somewhat unintuitivive. All this whitespace and line break behavious is driving me nuts... Is there a way to tell MediaWiki that it might ignore all whitespaces and linebreaks within my template definition expect the ones I explecitly want to have?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload