[TYPO3-mvc] creating two related objects in one form

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Sat Nov 6 23:31:22 CET 2010


Henjo Hoeksma wrote:
> I want to add a blog post from FE and attach a (or multiple!) tags to
> it. Tags will be value objects, and preferrably reusable, so a suggest
> feature should be possible too, but first things first.

Hello Henjo!

Haven't done much using Extbase in the past few weeks,
but in your case I guess the "tags" of a blog post is just
a "property" of the blog post itself. (So you don't need
2 objects in the form actually.)

Therefor I could imagine just having a field "tags" in the form
where you could enter comma separated tags. (Ofc this can be
pimped with Javascript - you could hide the "classic" form field
and add those tags via a JS function and build some sort of
AJAX thingy to only allow existing tags; also auto-suggestion etc.)

The field itself could be defined as the property of the
blog post itself, so it could be populated automatically on submission,
or you just define a separate field, to process it's values after the
form was submitted - e.g. validating the tags and mapping them onto
the blog post object.

Regards,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list