test-eibox

Z kapica.cz
Verze z 31. 3. 2026, 13:15, kterou vytvořil Keny (diskuse | příspěvky) (založena nová stránka s textem „The '''#eibox''' function replaces the {{Šablona|block}} template. For comparison, see the example code and its interpretation on the page. The first example demonstrates the use of the template: {{block|30|right|color=tomato|Content of the right box}}{{block|30|left|color=lightskyblue|Content of the left box.}} Text, which is placed between red and blue box… {{block|100|color=green|}} Text which continued after the green box. <syntaxhighlight lang…“)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)

The #eibox function replaces the {{block}} template. For comparison, see the example code and its interpretation on the page. The first example demonstrates the use of the template:

Content of the right box
Content of the left box.

Text, which is placed between red and blue box…

Text which continued after the green box.

{{block|30|right|color=tomato|Content of the right box}}{{block|30|left|color=lightskyblue|Content of the left box.}}
Text, which is placed between red and blue box…
{{block|100|color=green|}}
Text which continued after the green box.

Note that the green box is not displayed. This is because it has no content. Here is interpretation wikicode in HTML:

<div style="background: tomato;width: 30%;float: right; margin: 0px 0 0px 0px;">Content of the right box</div>
<div style="background: lightskyblue;width: 30%;float: left; margin: 0px 0px 0px 0;">Content of the left box.</div>
<p>Text, which is placed between red and blue box…
</p>
<div style="width: 100%;background: green;"></div>
<p>Text which continued after the green box.
</p>

#eibox do it same. The difference is that code processing occurs at a lower level. While the template is interpreted by the MediaWiki system, the extension functionality is handled at the PHP code level.

Content of the right box
Content of the left box.

Text, which is placed between red and blue box…

Text which continued after the green box.

{{#eibox:none|30|right|color=tomato|Content of the right box}}{{#eibox:none|30|left|color=lightskyblue|Content of the left box.}}
Text, which is placed between red and blue box…
{{#eibox:none|100|color=green|}}
Text which continued after the green box.

In HTML code…

<div class="eibox" style="width:30%;background:tomato;float:right;">Content of the right box</div><div class="eibox" style="width:30%;background:lightskyblue;float:left;">Content of the left box.</div>
<p>Text, which is placed between red and blue box…
</p>
<div class="eibox" style="width:100%;background:green;"></div>
<p>Text which continued after the green box.
</p>

But #eibox has more features, which I will demonstrate in the next subsections.