Add gallery images to concept detail page
This commit is contained in:
@@ -90,6 +90,11 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
|
||||
*/
|
||||
protected $headerImages;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
|
||||
*/
|
||||
protected $images;
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Product>
|
||||
*/
|
||||
@@ -110,6 +115,7 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
|
||||
$this->products = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
$this->teaserImages = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
$this->headerImages = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
$this->images = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,6 +332,22 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
|
||||
$this->headerImages = $headerImages;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
|
||||
*/
|
||||
public function getImages()
|
||||
{
|
||||
return $this->images;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $images
|
||||
*/
|
||||
public function setImages($images)
|
||||
{
|
||||
$this->images = $images;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \EP\EpProducts\Domain\Model\Product $product
|
||||
*/
|
||||
|
||||
+50
-1
@@ -25,7 +25,7 @@ return [
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => '--palette--;;top, --palette--;;naming, --palette--;;header, teaser, description, description_extended,
|
||||
--div--;Bilder/Dateien, teaser_images, header_images',
|
||||
--div--;Bilder/Dateien, teaser_images, header_images, images',
|
||||
],
|
||||
],
|
||||
'palettes' => [
|
||||
@@ -310,6 +310,55 @@ return [
|
||||
],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
|
||||
),
|
||||
],
|
||||
'images' => [
|
||||
'exclude' => 0,
|
||||
'label' => 'Galeriebilder',
|
||||
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
|
||||
'images',
|
||||
[
|
||||
'appearance' => [
|
||||
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
|
||||
],
|
||||
'overrideChildTca' => [
|
||||
'types' => [
|
||||
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
|
||||
'showitem' => '
|
||||
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
||||
--palette--;;filePalette',
|
||||
],
|
||||
],
|
||||
'columns' => [
|
||||
'crop' => [
|
||||
'config' => [
|
||||
'cropVariants' => [
|
||||
'default' => [
|
||||
'title' => 'Preview',
|
||||
'allowedAspectRatios' => [
|
||||
'preview' => [
|
||||
'title' => 'Standard',
|
||||
'value' => 1.8,
|
||||
],
|
||||
],
|
||||
],
|
||||
'zoom' => [
|
||||
'title' => 'Zoom',
|
||||
'allowedAspectRatios' => [
|
||||
'free' => [
|
||||
'title' => 'frei',
|
||||
'value' => 'NaN',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'maxitems' => 10
|
||||
],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
|
||||
),
|
||||
],
|
||||
'products' => [
|
||||
'exclude' => 0,
|
||||
|
||||
@@ -529,6 +529,7 @@ CREATE TABLE tx_epproducts_domain_model_concept
|
||||
header_subtitle varchar(255) DEFAULT '' NOT NULL,
|
||||
teaser_images int(11) unsigned NOT NULL default '0',
|
||||
header_images int(11) unsigned NOT NULL default '0',
|
||||
images int(11) unsigned NOT NULL default '0',
|
||||
|
||||
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
crdate int(11) unsigned DEFAULT '0' NOT NULL,
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
{concept.description -> f:format.html()}
|
||||
</div>
|
||||
<f:if condition="{teasers}">
|
||||
<f:then>
|
||||
<a class="anchor" id="teasers"></a>
|
||||
<div class="bg-zinc-50 p-4 mb-4"
|
||||
data-controller="teasergrid"
|
||||
@@ -74,12 +75,23 @@
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{concept.images -> f:count()} > 0">
|
||||
<f:render partial="ImageGallery" arguments="{images: concept.images, id: 'concept-{concept.uid}', thumbnails: 1}"/>
|
||||
</f:if>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{concept.descriptionExtended}">
|
||||
<div data-rte-content>
|
||||
{concept.descriptionExtended -> f:format.html()}
|
||||
</div>
|
||||
</f:if>
|
||||
<f:if condition="{teasers}">
|
||||
<f:if condition="{concept.images -> f:count()} > 0">
|
||||
<f:render partial="ImageGallery" arguments="{images: concept.images, id: 'concept-{concept.uid}', thumbnails: 1}"/>
|
||||
</f:if>
|
||||
</f:if>
|
||||
</div>
|
||||
<div class="col-span-3 lg:col-span-1">
|
||||
<ul class="list-none p-0 m-0 space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user