I'm struggling with this one.
I have a view which lists articles. Each article has a category, which is a entity referenced taxonomy term. When I visit a URL, my taxonomy matches something in the URL. For example, if I go to news/localnews, there's a taxonomy option whose value is news/localnews.
What I'd like to do is display only articles which contain the same taxonomy term as in the URL. I have no idea how to do this and I've been working on this problem for about 5 months. (Yep, I'm serious.) Any help would be greatly appreciated!
I'm sure there's some combination of filters, contextual filters, and relationships I need to set up, but in all my trying, I have not found it.
All I want to happen is for my site to display articles labeled as "local news" when they go to the local news page. A simple thing I'd figure would be default Drupal, but is a problem I have yet to solve.
Thanks,
Brendan
Comments
I believe there is a Taxomony
I believe there is a Taxomony Views in the Views setting list page (admin path: /admin/structure/views) that is disabled be default. enable this Views and it should be what you are looking for. The Views is called 'Taxonomy term'
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
I did enable that view but I
I did enable that view but I'm not sure if I need to do anything after that.
Once enabled, visit your term
Once enabled, visit your term page (news/localnews) and see if it is listing all articles filed under the term?
You need to remove or disaable your Views page for news/localnews as it is probably overriding the terms views page if you don't see any changes.
Or maybe i'm not understanding your issue?
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
I think that did work for me
I think that did work for me when I tried it, but the issue isn't like that.
I'm trying to create a block somewhere on my page to list these items. That's the tricky part. I'm wondering how I can use my URL to identify the taxonomy and tell the block to list articles with that taxonomy.
I think you are overthinking
I think you are overthinking this issue. If it is working, then you are in effect trying to recreate your own custom views display using blocks that is doing the same thing as using the default View term page. You then just need to update all the news menu item to link to each term page.
The Views term page can be set to use your teaser view display or fields display. I would set it to fields and add a relationship, something like 'Taxonomy term: Content with term' to expose more fields form your content type so you can add more fields to your display.
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
Maybe I don't understand that
Maybe I don't understand that solution exactly, but it seems like something that's close to what I need to do, but not exactly.
All I really want to do is add a block (or perhaps several) on my page which just displays a list of articles, which have taxonomy, and match the taxonomy in the URL.
I says several because I will be adding blocks with different filters and rules, formats, and styles, and will need to display the information in multiple places.
Is this possible? It must be, but I still (after about 5 months) haven't found the answer. :(
This might be the solution to
This might be the solution to your problem? https://buildamodule.com/forum/post/how-to-pass-taxonomy-terms-from-node...
-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien
DARN! I was really hoping
DARN! I was really hoping that would work! It seems like it's close... but it's not working yet.
Tutorial
https://www.daymuse.com/blogs/drupal-guide-related-content-term-views
Thanks, but I followed this
Thanks, but I followed this and it still is not working.
Here's a link to my site (pardon the dust): https://goo.gl/mb6gQU
Presently, I'm able to achieve this by creating unique views with their own set of rules for each page. That's annoying, especially when I have to make a change to the view. I'd like one view which can cover them all, which of course is the best way to do it, so I'm hoping I can accomplish this.
Thanks,
Brendan