[TYPO3-dev] edit mm tables in backend forms with TCA
Ernesto Baschny [cron IT]
ernst at cron-it.de
Thu Mar 9 11:09:10 CET 2006
Franz Holzinger schrieb am 08.03.2006 23:18:
>> I would abstract from that and provide an UI where the user can edit
>> these additional attributes for MM-relations that you (and others, me
>> included!) need in the most natural place, which is the place where the
>> MM-relation is defined. Which is when you select records in fields of
>> type 'group'. Also see my previous post on that subject.
> Yes there should be a connection from the place where the select box of
> the element from the foreign table is and the backend form of the MM table.
> I do not know what is the most usable way for the customer.
> Maybe 2 select boxes:
> one for the uid_local
> one for the uid_foreign
uid_local is always the "current" record the user is editing, why would
you need to have a select box for that?
Let's try an example, to see if what I am thinking (and what I've done
in another non-typo3-project) is not good enough. Maybe we are already
thinking of the same:
Let's say we have tables tx_books and tx_articles. Now on tx_books we
have a field of type 'group' called 'articles' that refers to records of
tx_articles, so that books might contain N articles. An article can also
be present in M books.
Now we also want the MM-relation to hold the page-number in which the
article starts in that specific book. So we have:
tx_books:
uid, articles, ...
tx_articles:
uid, ...
tx_books_articles_mm:
uid_local (books), uid_foreign (articles), sorting (required), page_number
What we currently have is: The user can open a tx_books record and have
a select-box where he can add records from type tx_articles using the
browse_link popup and the "move up/down" and "delete" icons.
But where will the user set the page-number of the articles in this
specific book?
My idea would be:
1) To add a new article to an book, one would open the tx_books record
for editing and push the "browse_links" button next to the "articles"
select-box.
2) In the "Select records" dialog you browse the page-tree and search
for the tx_article record you want to add.
3) In this *same* dialog (the browse_links popup) there is also a (new)
field called "Page Number:" (info comes from TCA). The user fills this
field out and then clicks on the selected article. Both information
(tx_article record AND page number) is transfered to the select-box
4) User saves the record, all information is saved in the MM-table.
5) To change the page-number of an article, the user opens the tx_books
record for editing.
6) A new icon is needed besides the articles select-box to change
relational information. One would mark one article in the list and click
this icon.
7) The "browse_links" button pops up, with the page-number and currently
selected article pre-selected. In this dialog there should be no way to
add multiple records (so no "+" links), we just want to edit the
currently selected MM-relation.
So in my view the following has to be changed:
a) enhance browse_links interface to support additional data to come
back to the requesting select-box.
b) add some features to these MM-relation select-boxes: possibility to
hold more than just the record-id, maybe using some kind of separator in
the value ("<uid>|page_number=323|...").
c) add a new icon to edit a specific item in a MM-relation select-box
(as explained in 6-7 above).
d) make sure the saving process (TCEmain?) knows how to handle this new
value that a MM-select-box might contain.
What do you think?
Cheers,
Ernesto
More information about the TYPO3-dev
mailing list