Hallo,
ich würde gerne in mein modifiziertes Template (news_full.html5) die Kommentarfunktion einbauen.
Code:
<section class="<?php echo $this->class; ?> ce_accordion ce_text block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
<a name="<?php echo $this->id;?>"></a>
<div class="layout_full block<?php echo $this->class; ?>">
<?php if ($this->hasMetaFields): ?>
<p class="info"><time datetime="<?php echo $this->datetime; ?>"><?php echo $this->date; ?></time> <?php echo $this->author; ?> <?php echo $this->commentCount; ?></p>
<?php endif; ?>
<h1><?php echo $this->newsHeadline; ?></h1>
<?php if ($this->hasSubHeadline): ?>
<h2><?php echo $this->subHeadline; ?></h2>
<?php endif; ?>
<div class="toggler"<?php if ($this->headlineStyle): ?> style="<?php echo $this->headlineStyle; ?>"<?php endif; ?>>
<div class="toggler_image"></div>
<?php echo $this->teaser;?>
</div>
<div class="accordion"><div>
<?php if (!$this->addBefore): ?>
<?php echo $this->text;?>
<?php endif; ?>
<?php if ($this->enclosure): ?>
<div class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<p><img src="<?php echo $enclosure['icon']; ?>" width="18" height="18" alt="<?php echo $enclosure['mime']; ?>" class="mime_icon"> <a href="<?php echo $enclosure['href']; ?>" title="<?php echo $enclosure['title']; ?>"><?php echo $enclosure['link']; ?> <span class="size">(<?php echo $enclosure['filesize']; ?>)</span></a></p>
<?php endforeach; ?>
<?php endif; ?>
<div id="social"><?php echo $this->sw_socialnetworks;?> </div>
</div>
</div></div>
</section>
Dieses template rufe ich in einem Artikel als Nachrichtenliste auf.
Ich stehe irgendwie auf dem Schlauch, wenn ich einfach die Zeilen von mod_newsreader.html5 nehme:
Code:
<?php if ($this->allowComments && ($this->comments || !$this->requireLogin)): ?>
<div class="ce_comments block">
<<?php echo $this->hlc; ?>><?php echo $this->addComment; ?></<?php echo $this->hlc; ?>>
<?php foreach ($this->comments as $comment) echo $comment; ?>
<?php echo $this->pagination; ?>
<?php include $this->getTemplate('mod_comment_form', 'html5'); ?>
</div>
<?php endif; ?>
hat er Probleme mit der foreach-Schleife (packe diese Zeilen in das obere tmpl vor "</section>"
PHP Warning: Invalid argument supplied for foreach() in ...
Kann mir jemand die Augen öffnen
Lesezeichen