User tests: Successful: Unsuccessful:
This adds to Joomla! a filter system like the used in google images to filter them. The idea was born in the JUX Code Sprint in Manchester
The main goal was to avoid the use of the left sidebar in item list managements to allow a full size item list. That will make available more space for columns and use the left side of the screen for the hot content instead of the filters. This PR only removes the sidebar filters but keeps the sidebar menu that is removed in a different JUX pull request. This is to ensure that all JUX contributions are fully independent.
JForm
forms for item list filtering. That saves us to deal with states & to hardcode selects in HTML. JLayout
so all the system can be easily moved, customised and/or reused. JForm
fields so adding and remove filters is as easy as copy 6-10 lines of code in an XML file.purchase_type
to banner clients. Also adds the missing ordering for some column headings:
New abstract class to create a select field with a predefined list of values. Fields that extend it basically have to add a list of values like:
/**
* Available options
*
* @var array
* @since 3.2
*/
protected $predefinedOptions = array(
'today' => 'COM_USERS_OPTION_RANGE_TODAY',
'past_week' => 'COM_USERS_OPTION_RANGE_PAST_WEEK',
'past_1month' => 'COM_USERS_OPTION_RANGE_PAST_1MONTH',
'past_3month' => 'COM_USERS_OPTION_RANGE_PAST_3MONTH',
'past_6month' => 'COM_USERS_OPTION_RANGE_PAST_6MONTH',
'past_year' => 'COM_USERS_OPTION_RANGE_PAST_YEAR',
'post_year' => 'COM_USERS_OPTION_RANGE_POST_YEAR',
);
The field also supports to filter a specific list of the available values adding to the field definition the attribute filter
. Sample field definition only selecting some of the previous values:
<field
name="range"
type="registrationdaterange"
filter="today,past_1month,past_6month"
label="COM_USERS_OPTION_FILTER_DATE"
description="COM_USERS_OPTION_FILTER_DATE"
onchange="this.form.submit();"
>
<option value="">COM_USERS_OPTION_FILTER_DATE</option>
</field>
Shows a list of content status. Values possible are:
/**
* Available statuses
*
* @var array
* @since 3.2
*/
protected $predefinedOptions = array(
'-2' => 'JTRASHED',
'0' => 'JUNPUBLISHED',
'1' => 'JPUBLISHED',
'2' => 'JARCHIVED',
'*' => 'JALL'
);
Shows a list of user account statuses. Values possible:
/**
* Available statuses
*
* @var array
* @since 3.2
*/
protected $predefinedOptions = array(
'0' => 'COM_USERS_ACTIVATED',
'1' => 'COM_USERS_UNACTIVATED'
);
Shows a nested list of user groups available. Sample use:
Shows a limit box for pagination. It's like the one generated by JPagination::getLimitBox
method but reusable & customisable outside.
The default use is:
<field
name="limit"
type="limitbox"
class="inputbox input-mini"
default="25"
label="COM_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
onchange="this.form.submit();"
/>
The default values are:
/**
* Default options
*
* @var array
*/
protected $defaultLimits = array(5, 10, 15, 20, 25, 30, 50, 100);
It supports attributes to modify the list of limits used without creating a new field:
limits
: Manually specify the limits shown. Sample:
append
: Append extra values to the default list. Sample:
remove
: Removes values of the default list. Sample:
Show a list of registration date ranges. Values possible:
/**
* Available options
*
* @var array
* @since 3.2
*/
protected $predefinedOptions = array(
'today' => 'COM_USERS_OPTION_RANGE_TODAY',
'past_week' => 'COM_USERS_OPTION_RANGE_PAST_WEEK',
'past_1month' => 'COM_USERS_OPTION_RANGE_PAST_1MONTH',
'past_3month' => 'COM_USERS_OPTION_RANGE_PAST_3MONTH',
'past_6month' => 'COM_USERS_OPTION_RANGE_PAST_6MONTH',
'past_year' => 'COM_USERS_OPTION_RANGE_PAST_YEAR',
'post_year' => 'COM_USERS_OPTION_RANGE_POST_YEAR',
);
Search tools can be implemented in a lot of places. This is the list of the done/possible managements where it can be/has been implemented:
The search tools system is in its first stage that means that "it works". In the future we hope:
Google
style list.Search tools was possible thanks to:
It was possible also thanks to the great Code Sprints concept created by the Joomla! PLT team & sponsored by Open Source Matters.
Hi Michael the boxes have the border when they are active but I see what you are talking about. Order an limit are always active so they are going to have a border always. I'll remove it
Updated & rebased vs the latest master and removed the borders from the always active select boxes.
After the meeting with @dbhurley & @brianteeman we decided to create a branch to be able to test search tools with:
small
columns to standarize sizesAs we will need to undo some of this changes I only did it for content. Changes are already commited for review.
Rebased again vs the latest master
Rebased again vs latest master
Awesome! Thanks for working on this guys!
Looks like it's out of sync with master again. Could you resync it?
Cheers
Ok. I fixed the conflicts & rebased this one more time. I also used the new hint attribute (for placeholder) added in the fields improvements
THANKS!
There are some issues after merge search tools:
JPATH_0
in language overrides view. ( See #2279 )Options
button dissappear (not a search tools issue). View checks ACL with: $canDo = JHelperContent::getActions($this->state->get('filter.category_id'), 0, 'com_banners');
GReat work - looking forward to seeing this in all managers now
Nice work, Roberto!
Question: in master branch, In articles manager, I'm still seeing (incorrectly) the left submenu, while it's not on your picture above, which is correct. Was this PR not supposed to remove the left columns where sub-menus are available ?
@phproberto Ok, thought to have read something different but i agree with your answer ofc, but then the PR to remove the side sub-menu got missing somewhere the rebasing to master of these 2 committed PRsĀ ? :
joomla-projects#51
joomla-projects#52
Are you doing a new PR against master for that ?
@phproberto : Asked @brianteeman to rebase his initial PR for this to master same as JUX team had to do for all their PRs:
Question - Is there a reason the sort/order and limit boxes have a border?