• Fabrik4.5.3 for J!5.3.0 and J!4.2+is out

    You must update from Fabrik4.5.1 if you are running Joomla!5.3.0

    See Announcements

Search Form customize dbjoin element

aksmith

Member
Hello:
I have a search form that filters a botanical db table of about 5000+ records.
Three of the elements in that list deal with height:
min_height (field)
max_height (field)
height (calc that returns the first 2 with a separator)

I tried a dbjoin element that queries the height element, but when I use a dropdown, the list displays the height for every single plant.
This returns an empty result - the search url uses the row id for the height value. Same issue with auto-complete.
Many of the plants have the same height (e.g. 8 - 10).
Select Distinct on the height field shows 184 variations.
Is there a way to have this search element return all the plants for a range (like 8 -10 or 10 - 20)?
Would a field in another table that contains all the distinct height values help?

Thanks in advance,
Alan
 
I tried a dbjoin element that queries the height element, but when I use a dropdown, the list displays the height for every single plant.
Not sure what you mean here.

You can add a Data-where to your dbjoin (with ajax update) watching some other element(s) with heights which the user can select.

You can use e.g. a dropdown element showing some reasonable min_heights ( or use eval populate to get all min_heights of your plants)
and then do a Data-where like

where {thistable}.min-height >= '{your-min_height-dropdown}' AND ...
 
1. Would the data where option work with a watch on a total of about 30 other fields?
2. Do have an example of the eval populate code to fetch min_heights?
3. I'm not sure how this solves the issue of oversized dropdown, which currently shows one value for each row, so that there are dozens of rows with a height value of 10 - 20, etc.
My goal is simply to have a way to search for a height value that will returns all the rows that match that value.
Thank you for the suggestions!
 
1. See screenshot - basically the client offers membership to landscape/ecological designers so they can search for the right plant based on a lot of criteria:
Screenshot 2025-03-12 at 5.29.44 PM.png

This is the most heavily used page on their site.
2. Filters would be SO much easier, but they really need/want a standalone search form.
I think the challenge is pointing a dbjoin element to a calc field.

-Alan
 
So you have a redirect plugin with "use as search data" to your plant list and the search form is working in principle (beside of Height and Spread)?
And you want additionally something like a range filter for Height (and Spread)?
 
It should be possible to combine the "Search data" with URL filtering:

Add fields to you search form with names which don't match the element names in your list (so they aren't use as "Search data"), e.g. 's_height_from', 's_height_to'.
Append these with the conditions you need to your jump URL, something like

&your-plant-height-element[value][0]={___s_height_from}&your-plant-height-element[value][1]={___s_height_to}&your-plant-height-element[condition]=BETWEEN
 

Members online

No members online now.
Back
Top