Created
November 6, 2015 08:23
-
-
Save koenig-digital/45b3bd8c5a28460148ca to your computer and use it in GitHub Desktop.
SQL, TCA, Model, Fluid to display more than one FAL Images / TYPO3 / Extbase / Extensionbuilder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can build this with extension builder - turn "more options" on! "bimagesingle" is the name of the column. | |
SQL: | |
bimagesingle int(11) unsigned DEFAULT '0' NOT NULL, | |
TCA: | |
'bimagesingle' => array( | |
'exclude' => 1, | |
'label' => 'LLL:EXT:juchgasse/Resources/Private/Language/locallang_db.xlf:tx_juchgasse_domain_model_juchgasse.bimagesingle', | |
'config' => | |
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( | |
'bimagesingle', | |
array('maxitems' => 25), | |
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] | |
), | |
), | |
MODEL: | |
/** | |
* bimagesingle | |
* | |
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> | |
* @cascade remove | |
*/ | |
protected $bimagesingle = NULL; | |
/** | |
* Returns the bimagesingle | |
* | |
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $bimagesingle | |
*/ | |
public function getBimagesingle() { | |
return $this->bimagesingle; | |
} | |
/** | |
* __construct | |
*/ | |
public function __construct() { | |
//Do not remove the next line: It would break the functionality | |
$this->initStorageObjects(); | |
} | |
/** | |
* Initializes all ObjectStorage properties | |
* Do not modify this method! | |
* It will be rewritten on each save in the extension builder | |
* You may modify the constructor of this class instead | |
* | |
* @return void | |
*/ | |
protected function initStorageObjects() { | |
$this->bimagesingle = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); | |
} | |
/** | |
* Adds a FileReference | |
* | |
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $bimagesingle | |
* @return void | |
*/ | |
public function addBimagesingle(\TYPO3\CMS\Extbase\Domain\Model\FileReference $bimagesingle) { | |
$this->bimagesingle->attach($bimagesingle); | |
} | |
/** | |
* Removes a FileReference | |
* | |
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $bimagesingleToRemove The FileReference to be removed | |
* @return void | |
*/ | |
public function removeBimagesingle(\TYPO3\CMS\Extbase\Domain\Model\FileReference $bimagesingleToRemove) { | |
$this->bimagesingle->detach($bimagesingleToRemove); | |
} | |
/** | |
* Returns the bimagesingle | |
* | |
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $bimagesingle | |
*/ | |
public function getBimagesingle() { | |
return $this->bimagesingle; | |
} | |
/** | |
* Sets the bimagesingle | |
* | |
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $bimagesingle | |
* @return void | |
*/ | |
public function setBimagesingle(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $bimagesingle) { | |
$this->bimagesingle = $bimagesingle; | |
} | |
FLUID: | |
<f:for each="{juchgasse.bimagesingle}" as="image" > | |
<f:image src="{image.originalResource.publicUrl}" width="200"/> | |
</f:for> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment