Closed (fixed)
Project:
Private Taxonomy Terms
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jul 2013 at 04:05 UTC
Updated:
19 Sep 2013 at 20:57 UTC
If we could get the user who created the taxonomy term into Views Relationship then it allows for views with contextual filters... it would allow for things such as listing each users terms on their profile page, etc etc...
This might be possible already... but I'll be darned if I can wrap my brain around how to do it without the user relationship.
Comments
Comment #1
trobey commentedI believe this is already possible. Under Filter criteria there is Taxonomy term: Current user. I just committed a change to label this as Private Taxonomy term: Current user. This allows you to display the terms belonging to the current user.
Note that admin/structure/taxonomy is accessible to users with either the permission "Administer own taxonomy" or "View private taxonomies." The accessible information is restricted based on the permissions. If the user has the "Views private taxonomies" they can view the terms for a vocabulary and filter based on the user.
Comment #2
melandren commentedOk I'm not sure that does the functionality I was looking for.
Current user filters to just taxonomy terms for the user who is logged in. What I'm trying to do is create a view where a user can see a list of another user's terms using a contextual filter. As an example, creating a block for a user's profile page that lists the terms they've created. Current User would let me see mine when logged in and let you see yours when logged in... but what if you wanted to see my list and I yours?
In my mind, private taxonomy is so great because it assigns ownership to terms moreso than keeping them hidden.
Again, maybe this is possible and I'm just approaching it wrong. Stranger things have happened. ;)
Comment #3
trobey commentedOkay, I added the relationship and the contextual filter. It is committed to 7.x-1.x-dev.
Comment #4
melandren commentedSeems to be working great.
Is it possible to add the relationship into a 'comment' view as well?
Comment #5
trobey commentedA comment view has a relationship between the comment and the content. So then you have a node and the relationship between the content and Taxonomy terms on the node can be added just like for a node. I do not see taxonomy terms attached directly to a comment. And the code I added has nothing to do with nodes or comments. So I do not see anything that would cause a problem in adding the relationship to a comment view.
Comment #6
melandren commentedRight. If the term is attached to the node.
If the term is a field attached to a comment, I'm not sure views has access to it.
For instance: If you have a content type called 'Story' and it has a private term field called 'Pseudonym'. You can access that via the comment view.
If the comment has that same pseudonym field attached to it, I don't think the comment view can find it.
Probably nitpick... but as comments become more and more like nodes (which seems to be the direction things are going) it might be worth that added relationship.
Apologies, if it's just me that can't make it work. ;)
Comment #7
trobey commentedI think you are right that as comments become more and more like nodes that this would be nice. I looked into this some more. When a Private term reference field is added to comments then there is no "Comment: Taxonomy terms on comment" relationship like there is the "Content: Taxonomy terms on node" relationship for nodes. But "Content: Taxonomy terms on node" comes from the Views module and is in the taxonomy.views.inc file. It is beyond the scope of this module to try to tackle problems related to regular taxonomy and comments and doing so I would be stepping on other peoples' toes. If I wrote something and then Views later added similar functionality then it would cause all sorts of problems. Perhaps it should be added to Views or someone should create a Comment taxonomy module. The code does not look like it would be very hard - perhaps just a cut and paste of the code for nodes with appropriate changes - but these things often turn out harder than they look.
Comment #8
trobey commented