Show list of users based on taxonomy term (D7) - drupal-7

I have a taxonomy vocabulary "Department". In the user account I have a taxonomy term reference field with this vocabulary. So each user can be assigned to one or more departments.
I used the module Taxonomy Meny to show the taxonomy terms in my main menu.
Now I want to show a list of users when I click on a department in the menu.
Does anybody have an idea how I could do this?
Thanks.

Note sure here, but I suppose you should be able to use the views module to achieve this. Use can show all user nodes (or a list by choosing fields) and enter the department as a contextual filter.
Uou can use views in 2 ways, to produce pages or blocks. Contextual filters are a bit easier with pages, but that might confilt with yout module.
I like this tutorial, it gives a clear insight in contextual filters. It should get you started.
http://www.metaltoad.com/blog/using-drupal-contextual-filters-views

Related

Joomla URL parameters

I would like to get your opinions and solutions on how can I solve this problem.
I have a website that displays restaurants, events and attractions in multiple cities and countries.
Right now I implemented the following structure:
Country A
--City A-1
----Restaurants
----Events
----Attractions
--City A-2
----Restaurants
----Events
----Attractions
Country B
--City B-1
----Restaurants
----Events
----Attractions
--City B-2
----Restaurants
----Events
----Attractions
There is so much redundancy, specially when it comes to modules that display content from specific categories.
What I thought would be a good solution, is to only create categories for Restaurants, Events and attractions, and figure out a way to specify which country and city by adding parameters to the URLS.
I would appreciate any thoughts and suggestions.
Thank you
You can't avoid creating the full menu in the menu manager.
As for modules you could add a textfield inside the module with an array like: 1,7:2,8... = menu_id_1,content_of_city_7:menu_id_2,content_of_city_8...
You will have just one module for each type (restaurant, event, attraction) connected to all menus you want to be displayed and you will check the content of it matching the menu id from url with your array.

Can't add contextual Filter (taxonomy term ID (with depth)) to a View (User)

please help me out here:
I can't find a contextual filter by taxonomy term with depth on a view of users and/or profiles. When I make a view of content it can be chosen. I'd like to provide a filter for Regions, so Filter for Europe should result in a List of Users from all over Europe and so on.
The users are associated with a taxonomy term.
Thanks for your help or any suggestions.
Christian
Unfortunately, for user object, you cannot use the filter "has taxonomy term". What you will have to do is add the term reference field that you have created to the user object as contextual filter instead.

How to know the link clicked by the user to set the breadcrumb using views in drupal 7?

I'll try to explain my problem giving a little context first.
I'm building a catalog of products and to categorize them I'm using a taxonomy tree with 4 sublevels. Each product can be related with one or more subcategories.
I used views to navigate the taxonomy tree to access the products related with each subcategory. To manage the breadcrumbs in here I redefined the hook_breadcrumb() function on my template.php and this is working perfectly.
The problems start here: when I get to the last level of subcategories I have the respective products and when I click one of the products it will enter the node page of that product. At this time I lose my breadcrumb trail because I entered the node. I could get the taxonomy tree of that product to build the breadcrumbs but the problem is that the product can be related with multiple subcategory terms.
So, in order to solve this problem I think that I need to know from wich path trail the visitor arrived to the product. In other words, I need to know the last taxonomy subcategory that the user visited to enter a specific product so that I can build the breadcrumbs correctly with that information.
So, can someone help me on how to know the path that the user was before entering a node?
Thanks in advance!
You can check http://drupal.org/project/cookiecrumbs a recent project which uses browsers history to show breadcrumb

Drupal 7 expanding fields

I have a field in a cms called 'services' the services is a lsit of checkboxes with the values
1|digital
2|web
3|print
4|apps
The issue is each of the options has a related url. Is there way to link a url to a 'service' or am I looking at taxonomy to solve this issue?
You need to use a taxonomy. A select list is simply a key/value pair with no other additional data. If you build a new taxonomy, you can either use the taxonomy URL for your purpose or you can add a Link field and give each term a specific URL and tie that in somehow, maybe through Views or a custom display.

Drupal 7 views filter by node's taxonomy term

I have a similar question to my previous one (Drupal 7 views filter by dynamic taxonomy term), it's only the other way round.
I have a "partner" content type, each with it's own taxonomy term. The other content type is a regular page with multiple terms from the "partner" vocabulary. In my regular nodes, I want to include a few of the "partners" in a view block.
The view should filter only those relevant partner nodes (those tagged with one of the regular node's tags).
Could it be done this way? The problem is that I can't get the term names from URL via contextual filters...
After googling the whole afternoon (and posting it there), I eventually found the answer.
It's based on a tutorial on scito.ch (thanks), with only a few modifications. On the Content: Has taxonomy term ID (with depth) filter, be sure to check the Allow multiple values checkbox. Also (there's a lot of wrong tuts for that), don't specify anything in the WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED. It's important you specify all those 3 contextual filters.
Hope this helps someone and saves him a sunny afternoon :)

Resources