Guten Abend Zusammen
bräuchte kurz Hilfe damit ich bei meinem Projekt weiterkomme ;-)
Ziel ist es (Nachrichtensystem), wenn ein Beitrag die CSS Klasse "first" drin hat (was ja beim ersten immer automatisch der fall ist) soll mir das Template das Bild in Originalgrösse anzeigen, ansonsten soll es mir das Bild in einer anderen Grösse anzeigen.
folgendes habe ich - funktioniert auch, nur, wenn der Beitrag nun wirklich die CSS Klase "first" drin hat, zeigt er mir das Bild zwei mal an. Habe ein wenig mühe wo ich nun if und dann else einfügen muss.
Code:
<div class="layout_latest block<?php echo $this->class; ?>">
<?php if(strpos($this->class,'first')): ?>
<?php if ($this->addImage): ?>
<div class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>"<?php echo $this->imgSize; ?> alt="<?php echo $this->alt; ?>" />
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<div class="caption"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->addImage): ?>
<div class="image_container<?php echo $this->floatClass; ?>"<?php if ($this->margin || $this->float): ?> style="<?php echo trim($this->margin . $this->float); ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?php echo $this->href; ?>"<?php echo $this->attributes; ?> title="<?php echo $this->alt; ?>">
<?php endif; ?>
<img src="<?php echo $this->src; ?>" width="335px" height="100px" alt="<?php echo $this->alt; ?>" />
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<div class="caption"><?php echo $this->caption; ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="layout_latest block<?php echo $this->class; ?> hs-teaser-over-image">
<h1><?php echo $this->text ? $this->linkHeadline : $this->newsHeadline; ?></h1>
<p class="teaser"><?php echo $this->teaser; ?></p>
<?php if ($this->text): ?>
<?php endif; ?>
</div></div>
ähmm ... ja, Danke bereits im Voraus ;-)
Lesezeichen