Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filtering by tag in the frontend #8846

Merged
merged 13 commits into from
May 4, 2016
Merged

Conversation

danielsmink
Copy link
Contributor

Resolves filtering by tags in the frontend. resolve #5998

How to test

  1. Create a fresh Joomla
  2. Create some articles with tags
  3. Create a new menu item -> articles -> category list
  4. Select 'Tag' as filter field
  5. Browse to the menu item in the frontend.
  6. Filter on any of the tags using the dropdown

Fix indents
Fix indents
Fix indents
Fix whitespace and more tabs
Fix whitespace and more tabs
@justinherrin
Copy link
Contributor

Can you also add "Tags" option to the Global Configuration area? I'm looking at the Global Configuration > Articles > List Layouts tab > Filter Field

@danielsmink
Copy link
Contributor Author

@justinherrin added to Global config as well. Thanks for the heads up! Found a little bug while doing that.

@ghost
Copy link

ghost commented Jan 17, 2016

I have tested this item 🔴 unsuccessfully on c26ed28

1. Label looks strange
1

  1. If no tag selected changing filter field Display # results in a message "no items".
    2
  2. Same behavior if you had selected a tag, got hits, and set back field to "Select Tag"
    This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8846.
    3

Addition

This is what I did:

Installed Joomla! 3.5.0-beta staging 2016-01-17 with demo datas (testing).
Applied patch.
Opened menu item All Front End Views > Article Category List
Changed category to: Sample-Data Articels.
Tabulator Category > Subcategory Levels: ALL
Tabulator List Layout > Filter Fields > Tags
Saved.

Added tags to several articles by batch button

Went to Content > Articles > Options button
Tabulator Blog/Featured Layouts > Include Subcategories: ALL
Saved

Front End... and so on.

@danielsmink
Copy link
Contributor Author

Thanks @bertmert I'll have a look at it today.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @bertmert


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

@danielsmink
Copy link
Contributor Author

Fixed both bugs with tagid 0. Removed the label all together so it's the same as in the backend.

Thanks for testing @bertmert

@ghost
Copy link

ghost commented Jan 23, 2016

I have tested this item 🔴 unsuccessfully on c3b4f1a

Success for Protostar template.

But not for Beez3 template.


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

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @bertmert


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

@danielsmink
Copy link
Contributor Author

Thanks again @bertmert for some reason I assumed the standard templates wouldn't use overrides. It's fixed now.

@joomla-cms-bot
Copy link

This PR has received new commits.

CC: @bertmert


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

@ghost
Copy link

ghost commented Feb 15, 2016

I have tested this item ✅ successfully on 143ba26


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

@genesisfan
Copy link

I have tested this item 🔴 unsuccessfully on 143ba26

Both templates Beez3 and Protostar been tested.
The principle works, just not quite logical IMHO.

When you select a tag with result 'There are no articles in this category...' then you are not able to select a different tag. The selection bar disappears. Only when you select the menu item again.

Secondly could you add a search option in the tags list? Quite useful when you have a lot of tags.


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

@ghost
Copy link

ghost commented Feb 19, 2016

When you select a tag with result 'There are no articles in this category...' then you are not able to select a different tag. The selection bar disappears. Only when you select the menu item again.

That's not a misbehavior related to this PR. Try with title filter and search for nonsense. Same behavior.

@genesisfan
Copy link

Agree for the search part. It's by design.
But, when the title filter stays, in cause of "there are no articles..." it is more sophisticated.

@danielsmink
Copy link
Contributor Author

@genesisfan I could fix that in a separate PR. Likewise with searching for a specific tag, I guess we could add in Typeahead. But the idea was same behavior as the backend. Which this PR solves.

@danielsmink
Copy link
Contributor Author

@genesisfan @bertmert how do you guys suggest we continue? As I said I'm more then happy to make the other alterations but I don't feel they are part of this PR.

@ghost
Copy link

ghost commented Feb 25, 2016

how do you guys suggest we continue?

I'm just a "helping user" and have nothing to decide here but from my point of view you have 2 successful tests and @genesisfan should differentiate and test again
with this in mind:

  • the problem that filter fields disappear if no items found is as old as Joomla I think. Not a fault of this PR and MUST be fixed otherwise.
    (And should be fixed in all Joomla core components with frontend list views together (consistency).)
  • The second part is an additional feature. All you need is a line
JHtml::_('formbehavior.chosen', 'select');

in a template override of list view if you want this feature
Voilà:
chosen-list-view

BUT: I've asked the question some time ago if Beez3 should get always "chosened" selects or if it's prefered that not. If yes it would be easy. Just add line above to a relevant core file. BUT: I never got an answer. Thus I wouldn't add this feature to this PR if it would be mine. Know what I mean? Sometimes smaller steps are the faster ones ;-)

EDIT: See:
#8919 (comment)

But Beez3 normally doesn't use "chosened selects". There it's a really strange behavior to have sometimes this or that style. I don't know a way to suppress already loaded formbehavior.chosen. ... Please advise! Should Beez3 use "chosened selects" ON ALL PAGES or not? Sometimes it's forced to use them sometimes not.

@genesisfan
Copy link

I have tested this item ✅ successfully on 143ba26

> the problem that filter fields disappear if no items found is as old as Joomla I think. Not a fault of this PR and MUST be fixed otherwise.

Agree @bertmert and therefore successfully tested.
It would be nice if this normal behavior of the filter disappears could be fixed in another PR.


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

@danielsmink
Copy link
Contributor Author

Thanks for testing @genesisfan !

@brianteeman
Copy link
Contributor

Looks great - RTC


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

@danielsmink
Copy link
Contributor Author

@brianteeman looks like the bot won't tag it :-/

Edit: and then it instantly did :-)

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 10, 2016
@stefanpolzer
Copy link

Hy danielsmink, thx for this, I working on a Project where I will us it.
Can anybody tell me if this it already in the 3.5.0-RC Version?
I could not find it there.

@brianteeman
Copy link
Contributor

@stefanpolzer No its not it was only tagged rtc after the release of RC

@rdeutz rdeutz added this to the Joomla! 3.6.0 milestone Apr 13, 2016
@rdeutz
Copy link
Contributor

rdeutz commented May 2, 2016

@danielsmink cloud you please check the merge conflicts, thanks

@rdeutz rdeutz merged commit 143ba26 into joomla:staging May 4, 2016
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 4, 2016
@Bakual Bakual mentioned this pull request Oct 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Tag-Filter in Frontend-ArticlesModel (should use the same load-functions like in the backend)
7 participants