[TYPO3-mvc] Preparing extensions for 6.x
Jan Kornblum
jan.kornblum at gmx.de
Sat Mar 23 12:26:37 CET 2013
Hi group,
i want to get common on how to prepare extensions for 6.x and later. So
as a first step i want to try it with a very simple extension: the
extension offers a slider for teaserelements. there is a database table
containing the "teaserelements" (title, text, link, image, and so on)
and an additional field in table "pages" (added to rootline-fields),
where the teaserelement uids are stored as commaseperated list. the
extenions code walks through the rootline
(foreach($GLOBALS['TSFE']->rootLine as $element){}) to get the uids of
the "teaserelements".
As far as i know tslib_pibase features will still be available after
6.x because this class will still extists under a different name. So in
case of this very simple extension it shouldn't be difficult to adjust
the extensions code. but i want to put it on completely "new feets"
without using old pibase features, just for learning a little more;)
What would be a good way to do it with extbase and especially how to
realize the relation between "pages" and "teaserelements" and the
rootline-functionality? I suppose that extbase won't support any
comma-separated-list relations in "pages", is this correct? So in this
case i would have to create a "pages" model and a "teaserlement" model
with an m:n relation, right? But in this case how could i "walk through
the rootline" as the relation isn't stored in an additional field in
table "pages" any longer, but in a third relations-table?
Another idea is to only create a "teaserelement" model (model,
repository, controller, view), extend pages with an additional field
where the teaserelement-uids are stored as it has been before (but not
creating a model for "pages" at all) and adding a new method to the
"teaserelement" repository like "findByRootline()". In this context,
should i use TYPO3\CMS\Core\Utility\RootlineUtility instead of
"$GLOBALS['TSFE']->rootLine"?
I know this is a very simple and certainly not difficult example, but i
just would just like to know how others, which are more "extbase
experienced", would solve it ;)
Kind regards, Jan
More information about the TYPO3-project-typo3v4mvc
mailing list