Reputation: 568
FYI, i'm a TYPO3 rookie :) I'm making my own extbase/fluid extension in my TYPO3 personal website to manage galleries. For now, i'm following this documentation : Developing TYPO3 Extensions with Extbase and Fluid
For now, I only built 2 classes in Domain/Model :
Variables are set, getters/setters too.
I well understood that I need to link both within a relationship ("1:n" ?) but I don't use the Extension Builder and want to understand by myself how to do that. I guess I have to edit the Gallery.php model to explain what is the relation I want to implement, but can't understand how to do.
Any help ?
Upvotes: 1
Views: 1220
Reputation: 3259
You already received some good answers.
Additional points (for programming a slideshow extension):
PictureModel.php:
/**
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
* @cascade remove
*/
protected $image = null;
Example TCA:
'picture' => [
'exclude' => true,
'label' => 'LLL:EXT:uniolslideshow/Resources/Private/Language/locallang_db.xlf:tx_uniolslideshow_domain_model_gallery.picture',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'foreign_table' => 'tx_uniolslideshow_domain_model_picture',
'MM' => 'tx_uniolslideshow_gallery_picture_mm',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
'wizards' => [
// the fun starts here ...
Upvotes: 1
Reputation: 2272
Maybe the blog example can help with relation: A journey through the Blog Example. https://docs.typo3.org/typo3cms/ExtbaseFluidBook/3-BlogExample/Index.html
Upvotes: 0
Reputation: 717
A great way to learn how to do this is to create an extension using the Extension Builder and then read the generated code.
If you want to add the relationship on your own, you would need to edit the ext_tables.sql
and add the columns to your TCA and in your models. Read chapter 6 of the book you mentioned and you'll find out what to do.
Upvotes: 1