? Failure
Related to # 8633

User tests: Successful: Unsuccessful:

avatar panopt
panopt
22 Dec 2015

Bring up a 'removedFilters' (array) option to the searchtools layout helper that allows to remove filters individually.

Testing

To test it you can change the file:
administrator/components/com_content/views/articles/tmpl/default.php

on line 48:

echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));

by:

echo JLayoutHelper::render('joomla.searchtools.default', array(
        'view' => $this,
        'options' => array(
                'removedFilters' => array()
        )
)); 

Then, add names of the searchtools fields you want to remove to the 'removedFilters' option array :

        'options' => array(
                'removedFilters' => array('filter_published', 'filter_category_id')
        )

and observe the result (filters removed) on the searchtools of:
/administrator/index.php?option=com_content&view=articles


capture du 2015-12-22 16 39 14ok
(screenshot: searchtools with all filters)


capture du 2015-12-22 16 34 10
(screenshot: searchtools with 'status' and 'category' filters removed)

avatar panopt panopt - open - 22 Dec 2015
avatar panopt panopt - change - 22 Dec 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Dec 2015
Labels Added: ?
avatar panopt panopt - change - 22 Dec 2015
Title
Remove filters individually when using the searchtools layout
Possibility to remove filters individually when using the searchtools layout helper
avatar panopt
panopt - comment - 23 Dec 2015

Thank you,
This is updated.

avatar infograf768
infograf768 - comment - 25 Dec 2015

Works for me when testing #8633

avatar brianteeman brianteeman - change - 28 Mar 2016
Category Layout
avatar AnishaVora AnishaVora - test_item - 9 Jul 2016 - Tested successfully
avatar AnishaVora
AnishaVora - comment - 9 Jul 2016

I have tested this item successfully on 307aada


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8767.

avatar gunjanpatel gunjanpatel - change - 14 Jul 2016
Rel_Number 0 8633
Relation Type Related to
avatar gunjanpatel gunjanpatel - test_item - 14 Jul 2016 - Tested successfully
avatar gunjanpatel
gunjanpatel - comment - 14 Jul 2016

I have tested this item successfully on 307aada


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8767.

avatar gunjanpatel gunjanpatel - change - 14 Jul 2016
Status Pending Ready to Commit
avatar gunjanpatel
gunjanpatel - comment - 14 Jul 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8767.

avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2016
Labels Added: ?
avatar roland-d
roland-d - comment - 16 Jul 2016

@panopt What is the use case here? Each view uses it's own filter_xx.xml file If you do not want certain fields you can leave them out.

Can you fix the conflicts too? Thank you.

avatar ggppdk
ggppdk - comment - 16 Jul 2016

@roland-d

i think a usage can be to display 1 or 2 important filters outside the sliders ?
i do it in some cases,

  • and current code does not allow such usage, and that is 1 of the reasons, that i don't use it
avatar gunjanpatel
gunjanpatel - comment - 18 Jul 2016

@panopt Please sync this branch. As it has conflicts. Thanks

avatar roland-d
roland-d - comment - 18 Jul 2016

@ggppdk Thank you for your input. If you want to display 1 or more filters outside the slider wouldn't you do a layout override?

From what I understand you would use 1 separate layout for placing the 1 or more filters outside the slider and another layout for creating the slider? That would be the same as creating your own layout as an override for the search tool layout.

@wilsonge What do you think of this change?

avatar ggppdk
ggppdk - comment - 19 Jul 2016

@roland-d
layout override ?
i meant custom layout for custom component

another reason for not using it is that i consider it sometimes a little confusing:
confusing

i think a hover tooltip like "author", "access", will be good since label is hidden,
clicking once to open it and once more to close it to see the type of filter is annoying,

but ok you get used to the place that every filter is ...

avatar panopt
panopt - comment - 19 Jul 2016

I found a case where filters are hard coded in the template:
administrator/components/com_categories/views/categories/tmpl/modal.php (see #8633)

So I thought "Damn, redundant code in several places ! This must be painful to maintain."

Note : It's even possible to go further since 'searchtools layout helper' brings standard filters that corresponds to the meta functionalities that should be implemented in many components : status, language, acces, author, categories, tags.

avatar panopt panopt - change - 19 Jul 2016
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2016-07-19 09:11:38
Closed_By panopt
avatar panopt panopt - close - 19 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 19 Jul 2016
avatar panopt panopt - close - 19 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jul 2016
Labels Removed: ?
avatar panopt panopt - reopen - 19 Jul 2016
avatar panopt panopt - change - 19 Jul 2016
Labels Removed: ?
avatar panopt panopt - change - 19 Jul 2016
Status New Pending
avatar panopt panopt - reopen - 19 Jul 2016
avatar roland-d
roland-d - comment - 26 Jul 2016

@ggppdk Sorry for my thickness but I still don't see the issue. Let me try to explain myself again :)

If you have a search tool filter as shown in the main description of this thread. That is controlled by the XML you pass to it. So if you don't want some filters to show, then don't add the options in the XML. That is what I am thinking.

As for your other point that the filters can be unclear and can be clarified with a tooltip. Yes I can see that working.

avatar wilsonge
wilsonge - comment - 26 Jul 2016

I guess the point is that you can't template override a xml file but you can template override a view?

avatar brianteeman
brianteeman - comment - 26 Jul 2016

Not being able to override an xml is potentially an issue moving forward. I
hit it yesterday trying to do some admin template redesigns

On 26 July 2016 at 09:50, George Wilson notifications@github.com wrote:

I guess the point is that you can't template override a xml file but you
can template override a view?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#8767 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8W982xrGI5Rv4-_SvN8wlmgPtN3Jks5qZco9gaJpZM4G6Bgc
.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar wilsonge
wilsonge - comment - 26 Jul 2016

XML files shouldn't be overridable in full. If you wish to skip fields you should render fields individually (rather than a full fieldset at once which we kinda do to cut corners) - or you edit the xml file on load in a plugin event.

Having said that adding shortcuts for 'easy' stuff like this is of course feasible

avatar dgt41
dgt41 - comment - 26 Jul 2016

@phproberto I think you have a nice solution on this XML override 😉

avatar ggppdk
ggppdk - comment - 26 Jul 2016

@roland-d

filtering implementation is good but, not enough for all cases

In some listings

  • i would need 1 or 2 important filters to be out of the slider
  • so i would need to call it twice ...

that is 1 of the reasons, that i prefer to use custom filtering solution in my views

avatar panopt
panopt - comment - 26 Jul 2016

I am embarrassed to let you down when I see all these reactions (thank you), but I do not have time anymore to take care of this snippet (I submitted it 6 months ago...).
Anyway a smarter solution has been proposed for the pointed problem ?
Can I close this patch ?

avatar mbabker
mbabker - comment - 26 Jul 2016

I think you have a nice solution on this XML override

I don't agree with the notion of creating overrides for XML forms. Yes, this isn't the "user friendly" way to do it, but that's exactly why there's the onContentPrepare(Data|Form) events in the MVC layer. Sadly, JForm itself has no hooks so you're stuck relying on something else to give you integration points for form manipulation.

Truth be told, I don't think we want to make form overrides as easy as template overrides because this gets into a point where you're manipulating data (structures and values) and you really need to understand what you're doing when you get here.

I know the context of what we're talking about is search tools, but ultimately that XML file is loaded into a JForm instance. So unless you're going to add more inconsistent behaviors at the MVC layer, whatever you do for this use case involving XML overrides affects all uses of JForm.

avatar wilsonge
wilsonge - comment - 26 Jul 2016

@panopt you definitely haven't let us down. Your proposal has sparked conversation which is even more important :) Thank you for everything you have done!

avatar ggppdk
ggppdk - comment - 26 Jul 2016

@panopt

anymore to take care of this snippet (I submitted it 6 months ago...).
Anyway a smarter solution has been proposed for the pointed problem

It should feel normal that some PRs, stay open for quite long, no frustration needed,

(i have felt it for a PR, that took considerable time, and now i will only do small PRs, unless i feel that there is good chance to be accepted)

Changes we propose effect others and can not be removed easily later, if they are found to be bogus or bad design choice, because they will be a B/C break

and I think you do not have to wait for anything

If you have not done the already:
you can copy: /layouts/joomla/searchtools/
to custom folder

  • customize it according to your needs ...., and load it ...

Just change ...

// Search tools bar
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));

Then when/if this change is accepted you,
you can use default layout later,

or you can just close this

avatar ggppdk
ggppdk - comment - 26 Jul 2016

Also if the purpose is just to hide it, add some targeted CSS , or to move some filter add some JS code

avatar franz-wohlkoenig franz-wohlkoenig - change - 6 Apr 2017
Status Pending Needs Review
avatar joomla-cms-bot joomla-cms-bot - edited - 6 Apr 2017
avatar roland-d
roland-d - comment - 13 May 2017

@wilsonge Is this something to take into J4?

avatar franz-wohlkoenig franz-wohlkoenig - change - 14 May 2017
Status Needs Review Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 22 May 2017
Status Discussion Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 May 2017

gently Reminder @wilsonge


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8767.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Jun 2017

Reminder @wilsonge


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8767.

avatar wilsonge
wilsonge - comment - 22 Jun 2017

We need to ensure that all our search tools are in xml forms (with appropriate plugin triggers for manipulation). But in my opinion I don't see the need for this in core

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Jun 2017

thanks @wilsonge.

If no other Decision i will close this PR at 23. July 2017.

avatar infograf768
infograf768 - comment - 22 Jun 2017

FYI, we did manipulate search tools to display exactly what we wanted in function of the situation, see example of code here:
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_associations/views/associations/view.html.php#L132-L136

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Jul 2017
Status Information Required Closed
Closed_Date 2016-07-19 09:11:38 2017-07-23 05:53:14
Closed_By panopt franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 23 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - close - 23 Jul 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 Jul 2017

closed as stated above.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8767.

Add a Comment

Login with GitHub to post a comment