Benutzer:Tequila/Sandkasten: Unterschied zwischen den Versionen

Aus AntamarWiki
Wechseln zu: Navigation, Suche
K
Zeile 1: Zeile 1:
 
<div style="position:relative; float:right; width:250px;">
 
<div style="position:relative; float:right; width:250px;">
 
<div style="background-color:#F4E6D2; text-align:center; font-size:120%; font-weight:bold; border:1px solid black; padding:0.4em;">{{{name}}}</div>
 
<div style="background-color:#F4E6D2; text-align:center; font-size:120%; font-weight:bold; border:1px solid black; padding:0.4em;">{{{name}}}</div>
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="text-align:center;">[[Bild:Leerwappen.png|150px]]<div style="font-size:80%; font-weight:bold; padding-bottom:6px;">[http://wiki.antamar-community.de/index.php?title=Spezial:Hochladen&wpDestFile=Wappen_{{PAGENAMEE}}.png Wappen hochladen]</div></div></div>
+
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="text-align:center; padding:6px 0px;">[[Bild:Leerwappen.png|150px]]<div style="font-size:80%; font-weight:bold;">[http://wiki.antamar-community.de/index.php?title=Spezial:Hochladen&wpDestFile=Wappen_{{PAGENAMEE}}.png Wappen hochladen]</div></div></div>
 
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; text-align:center; font-weight:bold; padding:0.4em;">Übersicht</div></div>
 
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; text-align:center; font-weight:bold; padding:0.4em;">Übersicht</div></div>
 
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Fläche</div><div style="padding:0.4em;">Unbekannt<br />mehrzeilig</div></div>
 
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Fläche</div><div style="padding:0.4em;">Unbekannt<br />mehrzeilig</div></div>
 +
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Einwohnerzahl</div><div style="padding:0.4em;">Unbekannt</div></div>
 +
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Marktrecht</div><div style="padding:0.4em;">Unbekannt</div></div>
 +
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; text-align:center; font-weight:bold; padding:0.4em;">Zugehörigkeit</div></div>
 +
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Kontinent</div><div style="padding:0.4em;">Unbekannt</div></div>
 +
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Kultur</div><div style="padding:0.4em;">Unbekannt</div></div>
 +
<div style="border-width:0px 1px 1px; border-style:solid;"><div style="background-color:#F4E6D2; font-weight:bold; width:100px; padding:0.4em; border-right:1px solid black; float:left;">Land</div><div style="padding:0.4em;">Unbekannt</div></div>
 
</div>
 
</div>
  
 +
Ich versuche hier die Infoboxen anstatt durch Tabellen durch div-Boxen und CSS-Formatierungen auszudrücken. Funktioniert das richtig, so ist das valider und sollte auch Serverlast sparen, da die meisten Infos aus der zentralen CSS-Datei ([[Mediawiki:Common.css|hier]]) kommen. Außerdem erlaubt es das leichte modifizieren sämtlicher Infoboxen.
  
{| border="1" cellpadding="5" cellspacing="0" align="left" width="250px" style="margin-left:1em;"
+
Derzeit gibt es jedoch noch ein paar Probleme:
! colspan="2" style="font-size:120%; text-align:center; background-color:#F4E6D2;" | {{{name}}}
+
*mehrzeilige Boxen werden nicht korrekt dargestellt
|-
+
*Bei den Einträgen fehlt der Abstand zum linken Rand
{{#ifeq: {{{wappen}}} | nein | | ! colspan="2" {{!}} {{#if: {{{wappen|}}} | [[Bild:{{{wappen}}}{{!}}center{{!}}Wappen der Stadt {{{name}}}{{!}}150px]] | {{#ifexist: Bild:Wappen_{{{name}}}.gif | [[Bild:Wappen_{{{name}}}.gif{{!}}center{{!}}Wappen der Stadt {{{name}}}{{!}}150px]] | {{#ifexist: Bild:Wappen_{{{name}}}.png | [[Bild:Wappen_{{{name}}}.png{{!}}center{{!}}Wappen der Stadt {{{name}}}{{!}}150px]] | [[Bild:Leerwappen.png{{!}}center{{!}}Kein Wappen vorhanden{{!}}150px]]<small>[http://wiki.antamar-community.de/index.php?title=Spezial:Hochladen&wpDestFile=Wappen_{{PAGENAMEE}}.png Wappen hochladen]</small><includeonly>[[Kategorie:Fehlendes Wappen]]</includeonly> }} }} }} }}
+
 
|-
+
Im folgenden findet sich ein möglicher Eintrag in die CSS-Datei, darunter befindet sich die Stadtboxvorlage mit div-Boxen und den CSS-Klassen. Da diese noch nicht existent sind sieht es derzeit etwas minimalistisch aus
! colspan="2" style="text-align:center; background-color:#F4E6D2;" | Übersicht
+
 
|-
+
<pre>
! style="background-color:#F4E6D2; text-align:left;" width="80px" | Fläche
+
.Infobox {
| {{#if: {{{fläche|}}} | {{{fläche}}} [[Antamarische_W%C3%A4hrungen_und_Einheiten#Fl.C3.A4chenma.C3.9Fe{{!}}Morgen]] | Unbekannt }}
+
position:relative;
|-
+
float:right;
! style="background-color:#F4E6D2; text-align:left;" | Einwohnerzahl
+
width:250px;
| {{#if: {{{einwohner|}}} | {{{einwohner}}} | Unbekannt }}
+
}
|-
+
 
! style="background-color:#F4E6D2; text-align:left;" | Marktrecht
+
.InfoboxBaustein {
| {{#if: {{{marktrecht|}}} | {{{marktrecht}}} | Unbekannt }}
+
border-width:0px 1px 1px;
|-
+
border-style:solid;
! colspan="2" style="text-align:center; background-color:#F4E6D2;" | Zugehörigkeit
+
}
|-
+
 
! style="background-color:#F4E6D2; text-align:left;" | Kontinent
+
.InfoboxTitel {
{{#if: {{{kontinent|}}} | [[{{{kontinent}}}]] | Unbekannt }}
+
background-color:#F4E6D2;
|-
+
text-align:center;
! style="background-color:#F4E6D2; text-align:left;" | Kultur
+
font-size:120%;
| {{#if: {{{kultur|}}} | [[{{{kultur}}}]] | Unbekannt }}
+
font-weight:bold;
|-
+
border:1px solid black;
! style="background-color:#F4E6D2; text-align:left;" | Land
+
padding:0.4em;
| {{#if: {{{land|}}} | [[{{{land}}}]] | Unbekannt }}
+
}
{{#if: {{{provinz|}}} | {{!}}-
+
 
! style="background-color:#F4E6D2; text-align:left;" {{!}} Provinz
+
.InfoboxUntertitel {
{{!}} [[{{{provinz}}}]] }}
+
background-color:#F4E6D2;
|}
+
text-align:center;
 +
font-weight:bold;
 +
padding:0.4em;
 +
}
 +
 
 +
.InfoboxZeileL {
 +
background-color:#F4E6D2;
 +
font-weight:bold;
 +
width:100px;
 +
padding:0.4em;
 +
border-right:1px solid black;
 +
float:left;
 +
}
 +
 
 +
.InfoboxZeileR {
 +
padding:0.4em;
 +
}
 +
 
 +
.InfoboxBild {
 +
text-align:center;
 +
padding:6px 0px;
 +
}
 +
 
 +
.InfoboxBildHochladen {
 +
font-size:80%;
 +
font-weight:bold;
 +
}
 +
</pre>
 +
 
 +
<div class="Infobox">
 +
<div class="InfoboxTitel">{{{name}}}</div>
 +
{{#ifeq: {{{wappen}}} | nein | | <div class="InfoboxBaustein"> {{#if: {{{wappen|}}} | [[Bild:{{{wappen}}}{{!}}center{{!}}Wappen der Stadt {{{name}}}{{!}}150px]] | {{#ifexist: Bild:Wappen_{{{name}}}.gif | [[Bild:Wappen_{{{name}}}.gif{{!}}center{{!}}Wappen der Stadt {{{name}}}{{!}}150px]] | {{#ifexist: Bild:Wappen_{{{name}}}.png | [[Bild:Wappen_{{{name}}}.png{{!}}center{{!}}Wappen der Stadt {{{name}}}{{!}}150px]] | [[Bild:Leerwappen.png{{!}}center{{!}}Kein Wappen vorhanden{{!}}150px]] <div class="InfoboxBildHochladen">[http://wiki.antamar-community.de/index.php?title=Spezial:Hochladen&wpDestFile=Wappen_{{PAGENAMEE}}.png Wappen hochladen]</div><includeonly>[[Kategorie:Fehlendes Wappen]]</includeonly> }} }} }} </div> }}
 +
<div class="InfoboxBaustein"><div class="InfoboxUntertitel">Übersicht</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxZeileL">Fläche</div><div class="InfoboxZeileR">{{#if: {{{fläche|}}} | {{{fläche}}} [[Antamarische_W%C3%A4hrungen_und_Einheiten#Fl.C3.A4chenma.C3.9Fe{{!}}Morgen]] | Unbekannt }}</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxZeileL">Einwohnerzahl</div><div class="InfoboxZeileR">{{#if: {{{einwohner|}}} | {{{einwohner}}} | Unbekannt }}</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxZeileL">Marktrecht</div><div class="InfoboxZeileR">{{#if: {{{marktrecht|}}} | {{{marktrecht}}} | Unbekannt }}</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxUntertitel">Zugehörigkeit</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxZeileL">Kontinent</div><div class="InfoboxZeileR">{{#if: {{{kontinent|}}} | [[{{{kontinent}}}]] | Unbekannt }}</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxZeileL">Kultur</div><div class="InfoboxZeileR">{{#if: {{{kultur|}}} | [[{{{kultur}}}]] | Unbekannt }}</div></div>
 +
<div class="InfoboxBaustein"><div class="InfoboxZeileL">Land</div><div class="InfoboxZeileR">{{#if: {{{land|}}} | [[{{{land}}}]] | Unbekannt }}</div></div>
 +
{{#if: {{{provinz|}}} | <div class="InfoboxBaustein"><div class="InfoboxZeileL">Provinz</div><div class="InfoboxZeileR">[[{{{provinz}}}]]</div></div> }}
 +
</div>

Version vom 25. Februar 2009, 23:29 Uhr

{{{name}}}
Übersicht
Fläche
Unbekannt
mehrzeilig
Einwohnerzahl
Unbekannt
Marktrecht
Unbekannt
Zugehörigkeit
Kontinent
Unbekannt
Kultur
Unbekannt
Land
Unbekannt

Ich versuche hier die Infoboxen anstatt durch Tabellen durch div-Boxen und CSS-Formatierungen auszudrücken. Funktioniert das richtig, so ist das valider und sollte auch Serverlast sparen, da die meisten Infos aus der zentralen CSS-Datei (hier) kommen. Außerdem erlaubt es das leichte modifizieren sämtlicher Infoboxen.

Derzeit gibt es jedoch noch ein paar Probleme:

  • mehrzeilige Boxen werden nicht korrekt dargestellt
  • Bei den Einträgen fehlt der Abstand zum linken Rand

Im folgenden findet sich ein möglicher Eintrag in die CSS-Datei, darunter befindet sich die Stadtboxvorlage mit div-Boxen und den CSS-Klassen. Da diese noch nicht existent sind sieht es derzeit etwas minimalistisch aus

.Infobox {
position:relative;
float:right;
width:250px;
}

.InfoboxBaustein {
border-width:0px 1px 1px;
border-style:solid;
}

.InfoboxTitel {
background-color:#F4E6D2;
text-align:center;
font-size:120%;
font-weight:bold;
border:1px solid black;
padding:0.4em;
}

.InfoboxUntertitel {
background-color:#F4E6D2;
text-align:center;
font-weight:bold;
padding:0.4em;
}

.InfoboxZeileL {
background-color:#F4E6D2;
font-weight:bold;
width:100px;
padding:0.4em;
border-right:1px solid black;
float:left;
}

.InfoboxZeileR {
padding:0.4em;
}

.InfoboxBild {
text-align:center;
padding:6px 0px;
}

.InfoboxBildHochladen {
font-size:80%;
font-weight:bold;
}
{{{name}}}
Übersicht
Fläche
Unbekannt
Einwohnerzahl
Unbekannt
Marktrecht
Unbekannt
Zugehörigkeit
Kontinent
Unbekannt
Kultur
Unbekannt
Land
Unbekannt