Meine Anpassung in tl_news:
PHP-Code:
$GLOBALS['TL_DCA']['tl_news']['palettes']['__selector__'][] = "addNewsTrend";
$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace('addImage;','addImage; {addNewsTrend_legend},addNewsTrend;',$GLOBALS['TL_DCA']['tl_news']['palettes']['default']);
$GLOBALS['TL_DCA']['tl_news']['subpalettes']['addNewsTrend'] = "set_newstrend";
$GLOBALS['TL_DCA']['tl_news']['fields']['addNewsTrend'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['addNewsTrend'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('submitOnChange'=>true),
'sql' => "char(1) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['set_newstrend'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['set_newstrend'],
'default' => 'none',
'exclude' => true,
'inputType' => 'radioTable',
'options' => array('up', 'none', 'down'),
'eval' => array('cols'=>4, 'tl_class'=>'w100'),
'sql' => "varchar(12) NOT NULL default ''"
);
sehe ich auch in der DB.
und hier das Template:
HTML-Code:
<div class="newsreader-full block<?= $this->class ?>" itemscope itemtype="http://schema.org/Article">
<span class="info"><?= \Contao\NewsModel::findById($this->pid)->headline ?></span>
<h1 itemprop="name"><?= $this->newsHeadline ?></h1>
<div class="divider-v1"></div>
<?php if ($this->hasSubHeadline): ?>
<h2><?= $this->subHeadline ?></h2>
<?php endif; ?>
<?php if ($this->hasMetaFields): ?>
<div class="info">
<?php if ($this->archive): ?><span class="archive"><?php echo $this->archive->title; ?> vom </span><?php endif; ?>
<?php if ($this->date): ?>
<span class="date"><span class="day"><?php echo $this->parseDate("d", $this->timestamp);?></span>.<span class="month"><?php echo $this->parseDate("m", $this->timestamp);?></span>.<span class="year"><?php echo $this->parseDate("Y", $this->timestamp);?></span>
<span class="hour"><?php echo $this->parseDate("H", $this->timestamp);?></span>:<span class="minutes"><?php echo $this->parseDate("i", $this->timestamp);?></span> Uhr
<?php endif; ?>
<?php if ($this->author): ?><span class="author"><?php echo $this->author; ?></span><?php endif; ?>
<?php if ($this->commentCount): ?><div class="comments"><?php echo $this->commentCount; ?></div><?php endif; ?>
</div>
<?php endif; ?>
<div class="img-container">
<img src="<?php echo $this->src; ?>" <?php echo $col->imgSize; ?> alt="<?php echo $this->alt; ?>" />
</div>
<div class="content-container contents">
<?php if ($this->hasText): ?>
<?= $this->text ?>
<?php else: ?>
<div class="ce_text block">
<?php if (!$this->addBefore): ?>
<?= $this->teaser ?>
<?php endif; ?>
<?php if ($this->addImage): ?>
<?php $this->insert('image', $this->arrData); ?>
<?php endif; ?>
<?php if ($this->addBefore): ?>
<?= $this->teaser ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($this->enclosure): ?>
<ul class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<li class="download-element ext-<?= $enclosure['extension'] ?>">
<a href="<?= $enclosure['href'] ?>" title="<?= $enclosure['title'] ?>"><?= $enclosure['link'] ?> <span class="size">(<?= $enclosure['filesize'] ?>)</span></a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
</div>
oben habe ich ein Beispiel aus dem Thread.
Kann ich die auch in einem individuellen Template verwenden?