Hello,
In the front-end when I go to Collector all items are listed. If I search for nothing, all items are listed. How can I stop both please?
Tim
Collector 0.4.0 showing all
Re: Collector 0.4.0 showing all
Hi,
By default, collector display all items.
In the component parameters (or menu item parameters), you can disable the parameter "Show entire listing".
By default, collector display all items.
In the component parameters (or menu item parameters), you can disable the parameter "Show entire listing".
Re: Collector 0.4.0 showing all
Thanks Steevo,
That fixed it.
Tim
That fixed it.
Tim
Re: Collector 0.4.0 showing all
One further question please.
How can I prevent people from searching for any word in an item's fields?
I want them only to be able to search for a specific item id, not date, description etc..
Thanks,
Tim
How can I prevent people from searching for any word in an item's fields?
I want them only to be able to search for a specific item id, not date, description etc..
Thanks,
Tim
Re: Collector 0.4.0 showing all
The only way for this is to hack code...
If you're using only one collection and just want to search for a specific field, that could be easy.
In the file components/com_collector/models/collection.php
at line 347
replace
by
replace ID_OF_YOUR_FIELD (the last line) by the id of the field that you want to search on. You can find it in the list of fields in admin interface.
If you're using only one collection and just want to search for a specific field, that could be easy.
In the file components/com_collector/models/collection.php
at line 347
replace
Code : Tout sélectionner
foreach ($fields as $field)
{
if ( $field->type == 3 )
{
$nameFilterCollection = 'filterfield_'.$field->id;
$valueFilterCollection = $this->_collection->parameters->get( $nameFilterCollection, 0 );
$filter_field = $reset ? $valueFilterCollection : $mainframe->getUserStateFromRequest( $option.'.collection.filter_field_'.$field->id, 'filter_field_'.$field->id, '', 'int' );
if ( $filter_field != '' )
{
$this->_search = 1;
$where .= ' AND v'.$field->id.'.value = "'.$filter_field.'"';
}
}
if ( $search_all_value != '' )
{
$this->_search = 1;
if ( $field->type == 3 )
{
$where2[] = 'd'.$field->id.'.content LIKE "%'.$search_all_value.'%"';
}
else
{
$where2[] = 'v'.$field->id.'.value LIKE "%'.$search_all_value.'%"';
}
}
}
Code : Tout sélectionner
foreach ($fields as $field)
{
if ( $field->type == 3 )
{
$nameFilterCollection = 'filterfield_'.$field->id;
$valueFilterCollection = $this->_collection->parameters->get( $nameFilterCollection, 0 );
$filter_field = $reset ? $valueFilterCollection : $mainframe->getUserStateFromRequest( $option.'.collection.filter_field_'.$field->id, 'filter_field_'.$field->id, '', 'int' );
if ( $filter_field != '' )
{
$this->_search = 1;
$where .= ' AND v'.$field->id.'.value = "'.$filter_field.'"';
}
}
}
if ( $search_all_value != '' )
{
$this->_search = 1;
$where2[] = 'vID_OF_YOUR_FIELD.value LIKE "%'.$search_all_value.'%"';
}
Re: Collector 0.4.0 showing all
Thanks ... that's brilliant. Excellent support!
Re: Collector 0.4.0 showing all
You're welcome.