Evtl. hast du das noch nicht ganz verstanden. Hier mal ne Galerie mit 8 Bildern, 4 pro Reihe.
HTML-Code:
<ul class="cols_4">
<li class="row_0 row_first even col_0 col_first">
<li class="row_0 row_first even col_1">
<li class="row_0 row_first even col_2">
<li class="row_0 row_first even col_3 col_last">
<li class="row_1 row_last odd col_0 col_first">
<li class="row_1 row_last odd col_1">
<li class="row_1 row_last odd col_2">
<li class="row_1 row_last odd col_3 col_last">
</ul>
Und hier eine mit 8 Bildern, 12 pro Reihe.
HTML-Code:
<ul class="cols_12">
<li class="row_0 row_first row_last even col_0 col_first">
<li class="row_0 row_first row_last even col_1">
<li class="row_0 row_first row_last even col_2">
<li class="row_0 row_first row_last even col_3">
<li class="row_0 row_first row_last even col_4">
<li class="row_0 row_first row_last even col_5">
<li class="row_0 row_first row_last even col_6">
<li class="row_0 row_first row_last even col_7">
</ul>
Du siehst, dass sich nur die Klassen ändern. Wenn du aber kein CSS hast, welches diese Klassen anspricht, dann ist es völlig egal, wieviele Reihen du einstellst.
Das einzige CSS aus dem Core, welches hier greift ist
PHP-Code:
/**
* Format the Contao image galleries (now rendered as unordered lists)
*/
.ce_gallery > ul {
margin: 0;
padding: 0;
overflow: hidden;
list-style: none;
}
.ce_gallery > ul li {
float: left;
}
.ce_gallery > ul li.col_first {
clear: left;
}
Die letzte Regel sorgt dafür, dass dass float:left gecleart wird. Also bei .col_first fängt jede Reihe links von vorne an. Wenn du das nicht möchtest kannst du das überschreiben, wie oben bereits erklärt.
PHP-Code:
.ce_gallery > ul li.col_first {
clear: none;
}
Das ist alles.
Wenn du mit Flexboxen arbeiten möchtest, kannst du das float:left auch überschreiben.
PHP-Code:
.ce_gallery > ul li {
float: none;
}
.ce_gallery > ul li.col_first {
clear: none;
}
.ce_gallery ul {
display: flex;
}
Schau dir im FE immer mit den Entwickler-Tools des Browsers den DOM an, nicht nur wie die Seite aussieht, damit du verstehst, was Contao bei welcher Einstellung ins FE bringt.
Lesezeichen