PHP-Code:
<?php
$cssCanvas = [
$this->class,
'portfolio',
'columns',
'is-multiline',
'is-mobile',
];
?>
<div class="<?php echo implode(' ', $cssCanvas) ?>"<?php echo $this->cssID ?>>
<?php $count=1; foreach ($this->portfolios as $portfolio): ?>
<?php $backimage = $this->getImageObject($portfolio->backgroundimage);
if ($portfolio->backgroundmedia == 'bg-image') {
$dataicon ='';
} elseif ($portfolio->backgroundmedia == 'bg-gallery') {
$dataicon ='';
} else $dataicon ='▶';
?>
<?php
$visible = !empty($portfolio->visible);
$visible = $visible && ('' === $portfolio->dateStart || time() >= strtotime($portfolio->dateStart));
$visible = $visible && ('' === $portfolio->dateStopp || time() <= strtotime($portfolio->dateStopp));
?>
<?php if ($visible): ?>
<article class="portfolio-item column <?php echo $portfolio->gridclass ?>">
...
</article>
<?php endif ?>
<?php endforeach ?>
</div>
<?php dump($this) ?>
PHP-Code:
<?php
return array(
'label' => [
'de' => ['Portfolio','Erstellt eine oder mehrere Portfolioboxen'],
],
'types' => ['content','module'],
'standardFields' => ['cssID'],
'contentCategory' => 'beRecont',
'moduleCategory' => 'beRecont',
'fields' => [
'variante' => [
'label' => [
'de' => ['Portfolio Variante','Wählen Sie eine Variante aus.'],
],
'inputType' => 'select',
'eval' => [
'tl_class' => 'w50',
],
'options' => [
'portfolio',
'portfolio-reveal',
],
'reference' => [
'portfolio' => ['de' => 'Variante 1'],
'portfolio-reveal' => ['de' => 'Variante 2 - not suppoRted yet'],
],
'default' => 'portfolio',
],
'portfolios' => [
'label' => [
'de' => ['Portfolio',''],
],
'elementLabel' => '%s. Box',
'inputType' => 'list',
/* 'minItems' => 1, */
'fields' => [
.....
'visibility' => [
'label' => ['Sichtbarkeit',''],
'inputType' => 'group',
],
'visible' => [
'label' => [
'de' => ['Unsichtbar','Das Element auf der Webseite nicht anzeigen.']
],
'inputType' => 'checkbox',
'eval' => [
'tl_class' => 'clr w50 m12',
],
],
'dateStart' => [
'label' => [
'de' => ['Anzeigen ab',''],
],
'inputType' => 'text',
'eval' => [
'tl_class' => 'w50 clr',
'rgxp' => 'datim',
'datepicker' => true,
],
],
'dateStopp' => [
'label' => [
'de' => ['Anzeigen bis',''],
],
'inputType' => 'text',
'eval' => [
'tl_class' => 'w50',
'rgxp' => 'datim',
'datepicker' => true,
],
],
],
],
],
);
Lesezeichen