By Aar0n on
K here is what I am trying to do.
Populate the view based on taxonomies applied to each currently logged in users nodeprofile.
a bit more detail...
Each user belongs to one or many taxonomy terms - this is achieved through assigning taxonomy terms to their nodeprofile
When they look at this "View" it will filter the content depending on the taxonomy terms applied to their nodeprofile
Any ideas here?
Comments
relatedviews
I have found a module http://drupal.org/project/relatedviews that is along the track of what I am trying to achieve
This module uses a filter "Taxonomy: Term from current node" which uses the first taxonomy term on the current node to filter to the view.
This is similar to what I am looking for except it does not offer the following features
*Only selects from the current node being viewed --- Want to be able to filter based on the current users nodeprofile
*Only filter using the first taxonomy term of the node ---- Want to be able to filter using all the taxonomy terms of the node
Time to customize!
I helped develop the related views module and I can tell you it won't do exactly what you're trying to do. I can also tell you there isn't an existing module (or combination of modules) that will either. You're either going to have to extend the existing modules or write a bit of custom glue to get what you want. I would recommend you add a views filter to the nodeprofile module such as "Taxonomy: Term from current user's nodeprofile" The implementation would be something like this:
Hope that helps!
Customizing relatedviews
I have managed to customize the relatedviews module so far to get the currently logged in users unique profile and grab the taxonomy terms out of it but It will only filter by one term still (I want to filter by all the terms in the node), which i cant figure out. (note: im a n00b).
If some one could maybe have a tinker with the code below or give me a couple of pointers that would be much appreciated.
I can start you off
This is in NO WAY tested. I am meerly looking at the code and drawing conclusions that may be wrong. When I inspect the code, it seems that we get all the terms and then throw all of them except the first one out. We then create an array from the single term we kept and pass it to the views module. The changes below should be a good place to start: