Contao – Content-Element Text und Bild responsive für Bootstrap
Responsive Darstellung des Content-Elements Text (fka. Text und Bild) für Bootstrap.
<?php $this->extend('block_searchable'); ?>
<?php $this->block('content'); ?>
<?php
$sharedWith = "col-xs-12 col-sm-8 col-md-8 col-lg-8";
$fullWidth = "col-xs-12 col-sm-12 col-md-12 col-lg-12";
?>
<?php if (!$this->addBefore): ?>
<div class="<?php if ($this->addImage AND (trim($this->floatClass) != 'float_above' AND trim($this->floatClass) != 'float_below') ) echo $sharedWith; else echo $fullWidth; ?>">
<?= $this->text ?>
</div>
<?php endif; ?>
<?php if ($this->addImage): ?>
<figure class="image_container<?= $this->floatClass ?> <?php if (trim($this->floatClass) != 'float_above' AND trim($this->floatClass) != 'float_below') echo "col-xs-12 col-sm-4 col-md-4 col-lg-4"; else echo "col-xs-12 col-sm-12 col-md-12 col-lg-12"; ?>
<?php if ( trim($this->floatClass) == 'float_right' ) echo "pull-right"; ?>"<?php if ($this->margin): ?> style="<?= $this->margin ?>"<?php endif; ?>>
<?php if ($this->href): ?>
<a href="<?= $this->href ?>"<?php if ($this->linkTitle): ?> title="<?= $this->linkTitle ?>"<?php endif; ?><?= $this->attributes ?>>
<?php endif; ?>
<?php $this->insert('picture_default', $this->picture); ?>
<?php if ($this->href): ?>
</a>
<?php endif; ?>
<?php if ($this->caption): ?>
<figcaption class="caption"><?= $this->caption ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>
<?php if ($this->addBefore): ?>
<div class="<?php if ($this->addImage AND (trim($this->floatClass) != 'float_above' AND trim($this->floatClass) != 'float_below') ) echo $sharedWith; else echo $fullWidth; ?>">
<?= $this->text ?>
</div>
<?php endif; ?>
<div class="clearfix"></div>
<?php $this->endblock(); ?>
Template Contao 3.5