Pedro Guillem
Pedro Guillem

Reputation: 53

How do I stop MediaWiki from adding html tags to my transcluded templates?

I splitted HTML of a complex page in 5 parts (head, navbar, includes, body, footer) and I created a template in mediawiki with each chunk.

I just want to build new pages calling all the templates...The idea is to only change the body section to do a new different page (as any simple templating engine on the planet):

Example of a new page

{{Template:Zone/head}}
{{Template:Zone/navbar}}
{{Template:Zone/includes}}
{{Template:Zone/WHATEVERBODY}}
{{Template:Zone/footer}}

My problem is that each template that I transclude is being imported within a pair of annoying <p > < /p > tags... which completly breaks my HTML.

I do not control admin access of the mediawiki server, nor are allowed to change ANYTHING in the config.

I already tried loading the files with [[template]] instead of {{template}}. I also saw some cryptic stuff on the documentation.. but frankly did not understand more.

The documentation on the transclusion implementation is written as if anybody could understand the alien logic of mediawiki.. which seems more like a complicated attempt to override HTML from scratch.

I expectmediawiki to simply load the 5 chunks of HTML and build my whole site.

Upvotes: 1

Views: 230

Answers (1)

Tgr
Tgr

Reputation: 28220

Template transclusion happens before parsing wikitext to HTML. <p> tags correspond to empty lines (double newlines). Make sure your templates do not have trailing newlines, or put them on the same line.

Upvotes: 1

Related Questions