Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
taxonomy data
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Apr 2009 at 20:01 UTC
Updated:
13 Sep 2010 at 19:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerthis is a hidden feature of views :)
here is the field taxonomy: term
see the screenshot for help, there is a rewrite output token [tid]
Comment #2
dawehnerso this is fixed
Comment #3
merlinofchaos commentedIt's probably not actually completely fixed. Given the new rewriting functionality, we probably now have a real need to get true access to the TID.
Comment #4
squarecandy commentedThanks for the screen shot dereine...
But I can't seem to replicate this in my view.
Attached are a screen shot of my "edit - field - Taxonomy: Term" and an export of my view.
Any clues for me?
Thanks!
Comment #5
squarecandy commentedOk - I got [tid] to appear like in deriene's screenshot by adding Field - Taxonomy: All Terms above Taxonomy: Term.
But this does not accomplish what I'm looking for. When I use the [tid] token from All Terms it gives me a text output of all of the terms associated with the node - what I want is to get the Term ID number from the list I've created with Taxonomy: Term so I can make it into a link and pass it to the URL.
So I can go from this kind of page:
http://berkfilm.srv1.graymatterhost.com/productionguide/list/2
to this one:
http://berkfilm.srv1.graymatterhost.com/productionguide/sub/81
where the last URL segment is a Term ID argument
I checked out Taxonomy Menu to try and do all of this, but I couldn't get it to do exactly what I need, so I'm trying to do it with views myself.
Comment #6
alanburke commentedSubscribe.
Would be useful to have the tid for advanced themeing.
Eg - Output Tid as a field [restricted by vocabulary if necessary].
Exclude from Display.
Now re-use in a template file as a class to theme the row.
It can be done by loading the full node in the temapate file, but that isn't ideal.
Regards
Alan
Comment #7
squarecandy commentedI've also noticed that there are several threads about converting taxonomy terms with special characters to and back from the URL path, which there doesn't seem to be a good solution for... My solution was to try to use TID in the URL instead of the term name, but then realized that views provides no way of creating a link with a numeric term TID in the url.
Is there an example or guide somewhere for the best way to integrate taxonomy and views? This seems like a pretty common thing to want to do:
If someone has figured out an "ideal" way to do this and wants to share, I would be happy to help with documenting it...
Thanks!
Comment #8
Max_Headroom commentedThis worked for me:
http://drupal.org/node/381346
Comment #9
mlncn commentedOur need was to get the term ID when limiting results to a specific vocabulary... which requires the "All terms" option.
There was no 'filter terms by vocabulary, provide term id' option -- when using taxonomy all terms, the only thing providing the filter by vocabulary option, it ONLY provides the term name (as link or plain).
This patch provides a third option, for TID. It attempts to keep the original variable profile (TRUE and FALSE) for linked term and plaintext term, so that it does not affect existing sites.
Comment #10
mlncn commentedIf it's possible to get this data without a patch, fantastic; or if this patch should be taking a very different approach, please put me in the right direction, but if this can just make life a little easier in the waning days of 2.x, I would hugely appreciate a commit.
Comment #11
dawehnerthere is no == TRUE needed, but sure thats minor.
As far as i understand it, it shouldn't brake any existing taxonomy tid field, or?
I'm on crack. Are you, too?
Comment #12
shadowx commentedFor squarecandy's purpose, maybe you could use "Taxonomy Redirect" module to accomplish your task. This module can rewrite typical "taxonomy/term/TERMID" path to new mapped path you want.
Comment #13
mlncn commentedStill using this on production and all's well, as long as the patch is in effect. Also a person at the DrupalCon Taxonomy session had this exact same problem, no term IDs available as fields. If only all questions directed my way were answered by patches written a week prior...
This works and is needed, still happy to change the implementation if there's a better way. Anyone able to test if this applies as-is to Views HEAD? It probably does but i will check or re-roll before setting this to RTBC.
Comment #14
gausarts commentedSubscribing. Currently looking for a way to exclude term ID from URL, just like the node. Thanks
Update: Marking this related => http://drupal.org/node/576032 :)
Comment #15
SeanBannister commentedJust tested the patch and it certainly solved my problem.
Is there any reason that TID is listed as an option on "Taxonomy: All terms". It took me a while to find it as I was expecting it to be listed as a separate field called "Taxonomy: TID".
The reason I thought this is it seems very similar to "Node: Nid" and "Node: Title".
Comment #16
verot commentedPatch from poster #9, updated to work with 6.x-2.7
Comment #17
dagmarThis code doesn't respect the http://drupal.org/coding-standards
Comment #18
VTM commentedWorks OK for a single term assignment.
Assigning two or more terms, makes the [tid] field (of "all terms") display all terms taxonomy IDs.
This is fine for display but when I want to output this field as a link, all assigned term IDs are ONE link, and the address of the link contains all terms IDs separated by the separator.
This generate an SQL syntax error...
Is there a solution for this, as I use more than one term.
Many thanks.
Comment #19
Jerome F commentedHi,
I rely on views customfield to do some php with my views fields.
I usually make use of the following code to display the available variables of my view :
It appears taxonomy all terms has no available array in $data ; why is that so and how and where can I get this variable ?
I found this related issue but that doesn't give me much hope to find out a solution.
http://drupal.org/node/371748
Comment #20
esmerel commentedNo work done on patch in more than 3 months
Comment #21
petu commentedStill actual for views 6.x-3.0-alpha3.
Comment #22
dawehner@petu
As long you don't want to continue the patch work this patch remains on won't fix.