ich hätte an da eine kleine frage, bei der ich nicht weiter komme und ja: ich hab schon gegoogelt und nachgeforscht, aber ich komm einfach nicht weiter.
mein ziel: ich möchte eine startseite, mit zwei spalten. (siehe anhang)
das hatte ich so gelöst:
zuerst die css datei:
Code: Alles auswählen
#startseite
{margin: 0 auto !important;
max-width: 900px;}
#startseite-group
{margin-top:10%;}
.section
{clear: both;
padding: 25px 0px;
margin: 0px;}
.col
{display: block;
float:left;
margin: 1% 0 1% 1.6%;
text-align: center;}
.col:first-child
{margin-left: 0;}
.group:before,
.group:after
{content:"";
display:table;}
.group:after
{clear:both;}
.group
{zoom:1; /* For IE 6/7 */}
.span_2_of_2
{width: 100%;}
.span_1_of_2
{width: 49.2%;}
@media only screen and (max-width: 700px)
{.col
{margin: 1% 0 1% 0%;}
}
@media only screen and (max-width: 700px)
{.span_2_of_2
{width: 100%;}
.span_1_of_2
{width: 100%;}
}
Code: Alles auswählen
<body>
<div id="startseite">
<div id="startseite-group">
<div class="section group">
<div class="col span_1_of_2">
<img src="<?php echo seo42::getMediaFile('block1.jpg'); ?>">
</div>
<div class="col span_1_of_2">
<a href="<?php echo rex_getUrl(23) ?>"><img src="<?php echo seo42::getMediaFile('block2.jpg'); ?>"></a>
</div>
</div>
<div class="section group">
<div class="col span_1_of_2">
<a href="<?php echo rex_getUrl(21) ?>"><img src="<?php echo seo42::getMediaFile('block3.jpg'); ?>"></a>
</div>
<!--
<div class="col span_1_of_2">
<a href="#"><img src="<?php echo seo42::getMediaFile('block4.jpg'); ?>"></a>
</div>
-->
</div>
</div>
</div>
</body>
</html>
und jetzt mein großes problem:
ich möchte das ganze in arrays definieren. dann hab ich also folgendes:
Code: Alles auswählen
// Arrays definieren
$links = array(23 => "block2.jpg", 21 => "block3.jpg", 13 => "block4.jpg");
<body>
<div id="startseite">
<div id="startseite-group">
<div class="section group">
<div class="col span_1_of_2">
<img src="<?php echo seo42::getMediaFile('block1.jpg'); ?>">
</div>
<?php
foreach($links as $linkID => $linkBild) {
print '<div class="col span_1_of_2">';
print '<a href="'. rex_getUrl($linkID) .'">'
.'<img src="'. seo42::getMediaFile($linkBild) .'"></a>';
print '</div>';
}
?>
</div>
</div>
</div>
</body>
</html>
nach dem letzten code, wird block 4 direkt unter block 3 gesetzt. anstatt rechts neben dran. ich komm aber irgendwie nicht weiter
gruß und ich hoffe ich hab mein problem verständlich aufgeschrieben