[Mediawiki-l] placement of tables from templates

Ira Abramov lists-MediaWiki-l at ira.abramov.org
Sat Jun 25 09:45:14 UTC 2005


lucky thing I'm bald already...

for the last hour or so I'm trying to understand how to get a template
with a table to display on the top of a text section. I won't bother you
with the live examples since my site is in Hebrew so I'll put it this
way - I wanted to recreate the "related articles" boxes that wikipedia
uses for timelines, James Bond films, and other article groups. the
difference is I wanted the navigation box to be on top. I could only get
it floated on the left or right. if I just put the {{nav}} on top
without a flot style, it will invariably display at the bottom of the
text section (before the next ==header==) and defy HTML logic.

even weirder - I discovered this happens only for the LAST table in the
LAST template, if several are listed...

to explain:

--- template 1 ---
{|
| table 1
|-}

{|
| table 2
|-}

--- template 2 ---

{|
| table 3
|-}

{|
| table 4
|-}

--- page foo ---
{{template 1}}
{{template 2}}

some text

paragraph two

==header==

--- final render ---

|table 1|
|table 2|
|table 3|

some text

paragraph two

|table 4|
<h2>header</h2>

--- end demo ---

finally my solution (discovered while typing this out) was to have the
{{nav}} template have a second, empty, table after the main one, and pop,
the first table displays on top correctly now.

Is this a bug or a "feature?"

-- 
Pavlov's dog
Ira Abramov
http://ira.abramov.org/email/



More information about the MediaWiki-l mailing list