Einführung ThumbPages und Fahrzeug-Farbwechsler
This commit is contained in:
44
templates/carcolor.phtml
Normal file
44
templates/carcolor.phtml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
$registry = \Helper\Registry::getInstance();
|
||||
$imagePath = $registry->editorConfig['mediaPrefix'] . $registry->navID . '/';
|
||||
$imageData = json_decode($this->data['carColorImages']);
|
||||
|
||||
$images = array();
|
||||
$thumbs = array();
|
||||
|
||||
$editorData = '';
|
||||
if ($this->isEditable === true)
|
||||
{
|
||||
$editorData = ' data-editor="CarColor" data-id="' . $this->data['carColorID'] . '" data-element="CarColor_' . $this->data['carColorID'] . '"';
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="row"<?php echo $editorData; ?>>
|
||||
<div class="col-md-12 car-color">
|
||||
<?php
|
||||
foreach ($imageData as $key => $image)
|
||||
{
|
||||
$imageName = explode('.', $image);
|
||||
$extension = '.' . end($imageName);
|
||||
$thumb = str_replace($extension, '-thumb' . $extension, $image);
|
||||
$thumbs[] = '<img data-thumb="' . $key . '" src="' . $imagePath . $thumb . '"/>';
|
||||
|
||||
?>
|
||||
<img class="center-block img-responsive" data-image="<?php echo $key; ?>" src="<?php echo $imagePath . $image; ?>"/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-12 car-color-thumbs text-center">
|
||||
<?php
|
||||
|
||||
foreach ($thumbs as $thumb)
|
||||
{
|
||||
echo $thumb;
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12"> </div>
|
||||
|
||||
43
templates/thumb.phtml
Normal file
43
templates/thumb.phtml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$registry = \Helper\Registry::getInstance();
|
||||
$imagePath = $registry->editorConfig['mediaPrefix'] . $registry->navID . '/';
|
||||
$images = json_decode($this->data['thumbImages']);
|
||||
$headlines = json_decode($this->data['thumbHeadlines']);
|
||||
$texts = json_decode($this->data['thumbTexts']);
|
||||
|
||||
$editorData = '';
|
||||
if ($this->isEditable === true)
|
||||
{
|
||||
$editorData = ' data-editor="Thumb" data-id="' . $this->data['thumbID'] . '" data-element="Thumb_' . $this->data['thumbID'] . '"';
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="row thumbPage"<?php echo $editorData; ?>>
|
||||
<?php
|
||||
foreach ($images as $key => $image)
|
||||
{
|
||||
?>
|
||||
<div class="col-xs-6 col-md-3">
|
||||
<div class="thumbnail">
|
||||
<img src="<?php echo $imagePath . $image; ?>"/>
|
||||
<div class="caption">
|
||||
<p><b><?php echo $headlines[$key]; ?></b></p>
|
||||
<?php
|
||||
|
||||
if (isset($texts[$key]))
|
||||
{
|
||||
?>
|
||||
<p><?php echo $texts[$key]; ?></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="row"> </div>
|
||||
|
||||
Reference in New Issue
Block a user