Closed neyworg closed 11 years ago
Please standardize pull down filters between views.
@neyworg , it will be done... did restrict myself to the eventslist but will add it to the to-do list...
// Just wondering if this should be done, because wehn having a venue the list will show the same place, state etc and i guess you don't have to select them.
Imagine having thousands of events spread out in over thousands of venues? Filtering options actually become really important.
in that case it's indeed really important, but was wondering if it needed to have all the filtering options there with the same venue. So if a venue is selected is it then usefull to select at street, city as it's the same for the venue.
for Simplelist and Category Events for sure.. but since the code is easily cut/paste from view to view would it not be just easier to keep them identical? To make them all uniform and standard? Same look/feel no matter what page you go to?
:) you do have a point (it will be added)
and a little add: if you want to change it yourself you're welcome to do so, otherwise it will be done at the end of the week..
I would, but odds you would have to come back after me and fix it. I lack!! So a sample of what I am talking about from models/eventlist.php
//###############
if ($elsettings->filter)
{
$filter = JRequest::getString('filter', '', 'request');
$filter_type = JRequest::getWord('filter_type', '', 'request');
if ($filter)
{
// clean filter variables
$filter = JString::strtolower($filter);
$filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
$filter_type = JString::strtolower($filter_type);
switch ($filter_type)
{
case 'title' :
$where .= ' AND LOWER( a.title ) LIKE '.$filter;
break;
case 'venue' :
$where .= ' AND LOWER( l.venue ) LIKE '.$filter;
break;
case 'city' :
$where .= ' AND LOWER( l.city ) LIKE '.$filter;
break;
case 'date' :
$where .= ' AND LOWER( a.dates ) LIKE '.$filter;
break;
case 'type':
$where .= ' AND LOWER( c.catname ) LIKE '.$filter;
break;
case 'state':
$where .= ' AND LOWER( l.state ) LIKE '.$filter;
break;
}
}
}
if ($params->get('filter'))
{
$filter = JRequest::getString('date', '', 'request');
if ($filter)
{
// clean filter variables
$filter = JString::strtolower($filter);
$filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
$where .= ' AND LOWER( a.dates ) LIKE '.$filter;
}
}
if ($params->get('filter'))
{
$filter = JRequest::getString('category', '', 'request');
if ($filter)
{
// clean filter variables
$filter = JString::strtolower($filter);
$filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
$where .= ' AND LOWER( c.catname ) LIKE '.$filter;
}
}
if ($params->get('filter'))
{
$filter = JRequest::getString('state', '', 'request');
if ($filter)
{
// clean filter variables
$filter = JString::strtolower($filter);
$filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
$where .= ' AND LOWER( l.state ) LIKE '.$filter;
}
}
if ($params->get('filter'))
{
$filter = JRequest::getString('city', '', 'request');
if ($filter)
{
// clean filter variables
$filter = JString::strtolower($filter);
$filter = $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
$where .= ' AND LOWER( l.city ) LIKE '.$filter;
}
}
return $where;
}
The hope was to have a filter that we can drill with. &city=omaha&state=nebraska can even add &country=US
I know this does not accomplish that, but I lack the skills.
about the drill down, maybe it can be done like the way of the search view. -> when selecting continent the country box appears, a city can be choosen, etc...
I do not understand what you mean by search view. But to give you a working example of above:
http://www.usyw.org/events?category=tournaments&city=Porterville&state=California http://www.usyw.org/events?state=California http://www.usyw.org/events?category=tournaments&state=California
ahh, thx for the links.
In the search view of JEM you can search for a title but also select an continent. When pressing that filter you wil get a selectlist for country, then city etc.. but it are new boxes that are appearing, perhaps the javascript & code for it can be used and it has to be done in some other way. so not sure at the moment.
Yes, it will work.. and truth is if search code migrated to list views then search view is pointless. Also filter needs to be collapsible or hidden.
This request has been effectively neutered by the way the new filtering is done making #48 even more critical to be fixed before 2.0 release.
@neyworg thx, learned a new english word :). was just thinking can it be handy if you could select multiple values in the filter?. So when you go to eventlist or other view, click at the filter, you can tick multiple values to search, fill in a word to search and press search?.
It's possible to retrieve the ticked values and accordingly you can do something with that in the model. // it's like ticking the categories for an event in the backend but a little bit different.
Drop down filters are now tied to $jemsettings->show____ I understand and agree
However in my case I will have to immediately modify JEM to have filters work like I want. /if ($jemsettings->showcat == 1) { $filters[] = JHTML::('select.option', '4', JText::_( 'COM_JEMCATEGORY' ) ); }/ $filters[] = JHTML::('select.option', '4', JText::( 'COM_JEM_CATEGORY' ) );
I do not want to show the category column, however I want to filter it.
?filter=4&search=clinics&filter=5&search=iowa
I am going to close this, because it is working as it should and can easily be modified to suit needs. We can handle this via HOWTO modification document.
filters for search for various views is limited. Query already grabs information so why not use it to $filter_type?
Example in modes/eventlist.php // ############### case 'category' : $where .= ' AND LOWER( c.catname ) LIKE '.$filter; break;
See in action at: http://www.usyw.org/events?category=tournaments or http://www.usyw.org/events?category=tournaments&filter_type=state&filter=Iowa
Fields that can be done this way are State, Date, Category,... whatever else makes sense.