Closed Suley-Cyplon closed 6 years ago
I hope I understood you. You should call the filters and grid items from a database:
Your MySQLi SQL
<?php $rsFilter = new WA_MySQLi_RS("rsFilter",$Database_Connection,0); $rsFilter->setQuery("SELECT SUBSTRING_INDEX( airlines.airline_name, ' ', 1 ) AS airline_first_name, airlines.airline_name FROM airlines"); $rsFilter->execute(); ?>
Your filter:
<ul><li class="active" data-filter="*">All</li> <?php while(!$rsFilter->atEnd()) { ?> <li data-filter=".<?php echo($rsFilter->getColumnVal("airline_first_name")); ?>"><?php echo($rsFilter->getColumnVal("airline_name")); ?></li> <?php $rsFilter->moveNext(); } $rsFilter->moveFirst(); //return RS to first record ?> </ul>
Hi Guys
I've searched everywhere online and cannot find anything that relates to what I'm trying to achieve. I'm trying to add filters to a group, dynamically using the selectors in my grid.
For example: --- Airlines is the Group of the Filters ------ EasyJet ------ British Airways ------ Monarch ------ Ryanair etc. etc.
But I want to create these Filters only if they are within the Isotope Grid. So, something that can look at the tags (selectors) within the grid-item, and create a new Isotope Filter under the Airlines Group Filter.
Rather than having to create a Filter for every Airlines in the world, and having to hide them all if they have 0 results, which as you can imagine would be near-impossible to manage.
Is there such a thing? Any help or guidance to a similar thread would be much appreciated.
Thanks
Suley