[TYPO3-dev] Only showing a subset of items in a selectbox

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Sep 6 10:59:30 CEST 2010


Hey,

...
> 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.

I think I'd go for the foreign_where approach.

> 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.)

It can handle group fields, but you have to fool extbase by also 
defining a 'foreign_table' in your group field TCA, not just via 
"allowed". But this only allows the use of one table for the group 
fields in extbase. There's also a pending patch from me on forge that 
enables the native use of group fields in extbase - but still not for 
mixed tables.

> 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?

you could use a itemsProcFunc and fetch the records of your selectbox 
via custom queries if that would be an option.

-- 
kind regards,
Franz Koch




More information about the TYPO3-dev mailing list