[TYPO3-dev] Only showing a subset of items in a selectbox
Thomas "Thasmo" Deinhamer
thasmo at gmail.com
Sun Sep 5 23:14:12 CEST 2010
Hi to all!
Imagine there are the following three tables in an extension:
* contact
* product
* stock
These are the use cases:
* Table "contact" holds all kind of contacts.
* Table "product" holds products. Every product should have a
manufacturer, that's a relation to the table "contact".
Table "stock" holds a products stock quantity. A stock itself should be
a assigned to a depot, that's again a relation to the table "contact".
Now, the fields "manufacturer" and "depot" are configured as select
field and list all available records of the table "contact".
Now imagine there are a lot of (~100 or more) contact records, where
half of them are manufacturers and the other half are depots.
Is there a nice way of only displaying manufacturers inside the
manufacturer select field and only depots inside the depot select field?
Of course the records (manufacturers and depots) are stored in separate
sys-folders, for maintenance purposes primarily.
For "filtering" the records I can think of these solutions:
1) Use the general record storage page.
2) Don't use a select field, but a group (db) field.
3) Use a custom foreign_where statement to match desired records.
For selecting a single record (1:n, one product has only one
manufacturer) I prefer the group (db) field, as selecting a record
within a huge sys-folder structure is quite fast and convenient. The
main disadvantage at present is, that Extbase still can't handle those
group fields. (And I'm using Extbase for the extension.)
For selecting multiple records it gets a bit "inconvenient" imo. Number
1) lacks the possibility to select multiple sysfolders, which is a real
disadvantage. Number 3) requires me to add a new field "purpose" or
similar, which would be a select/checkbox field, to select different
purposes, in my case they would be "product" and "stock" or similar.
Actually I can't think of any other useful "filter" mechanisms.
Are there any other solutions or approaches? Any ideas?
Thanks a lot,
Thomas
More information about the TYPO3-dev
mailing list