Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you stop the automatic line break after templates in mediawiki?

Tags:

mediawiki

In mediawiki, whenever you embed a template into an article, it is always proceeded by a line break (as far as I know). Is there some way to prevent this so that I may place templates next to one another without the second one being on a new line?

like image 236
Koukaakiva Avatar asked Mar 26 '09 18:03

Koukaakiva


People also ask

How do I use a Mediawiki template?

To use the template in a page, type "{{header}}". What marks the use of the template are the "{" and "}" characters, also known as curly brackets. To replace the name of the template with its contents directly in the source wikitext before the text is saved, use "{{subst:header}}".

How do you go to the next line in Wikipedia?

The <br /> or <br> tags are used for a single forced line break.

How do you create a paragraph in Wikipedia?

If you add two line breaks (by pressing return twice) to the source text, Wikipedia will create a new paragraph. It is uncontroversial that paragraphs should be used to make articles easy to read.


1 Answers

Use the <includeonly> tag if you didn't already, and make sure not to put any returns in your template before the </includeonly>

So

<includeonly>This is a template. </includeonly>

makes {{Template}}{{Template}} output as

This is a template. This is a template


But,

<includeonly>This is a template. 

</includeonly>

makes {{Template}}{{Template}} output as

This is a template. 

This is a template

Even single returns are dangerous. If template A contains:

<includeonly>{{B}}
</includeonly>

and template B contains:

<includeonly>Text
</includeonly>

then when you insert {{A}} into your page, both returns are subsequent and give paragraph break.

like image 75
Adrian Archer Avatar answered Nov 04 '22 05:11

Adrian Archer