Hi, does select dynamic cascade support dynamically setting the table from which retrieving the values? I mean, instead of typing the name of the table, typing a select that retrieves the name of the table.
Imagine for example an inventory of product. Each product type is stored in its table (and is a different content type): when using a select dynamic cascade to first select the type of product and then the product item, since product items are stored in different tables according to types, the select dynamic cascade should pick up values from different tables, so the source table parameter is the result of a query that retrieves the table name in another table of product types <=> products tables.
this is not possible directly, but you can do it in a different way -
use normal select (or select dynamic) to show product types, then using
conditionals show the right select dynamic to pick items - create one
for each product type.
Hi, thanks, I knew it could be done like that but it is feasible just for a small number of product type. Can it be added as a feature request? It should not be that cumplicated (launching the select before for the FROM clause), it may be a good enhancement for this very useful plugin.
Actually, you can already do this I think - using free query mode you could do sth like this in the second select if you have a table that holds all your content types names and ids (the same as you would need for the first select) - you jsust need a subquery in FROM (and perhaps also a concat to add #__ )
SELECT pi.name as text, pi.id as value FROM (SELECT ct.name FROM #content_types_table AS at WHERE ct.id=[parent]) AS pi
Free mode just runs mysql query (with few replacements like [parent] which gets replaced by value from previous cascade). So whatever works in mysql works in there.This is why
So example I gave you should work unless there is some problem with regexes, here is mysql manual on subqueries in FROM, you can Google fro more tutorials